Skip to content

Commit

Permalink
Merge branch 'release' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tw-yshuang committed May 6, 2024
2 parents 97d4dae + 8f34bee commit d74b56e
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 86 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name = "pypi"
click = "*"
pyyaml = "*"
pandas = "*"
watchdog = "*"

[dev-packages]
black = "*"
Expand Down
172 changes: 104 additions & 68 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ monitor_files=('jobs/monitor_exec' 'jobs/monitor.log')
schedule_files=('jobs/booking.csv' 'jobs/using.csv' 'jobs/used.csv')
cfg_files=('capability_config.yaml' 'host_deploy.yaml' 'users_config.yaml')
monitor_program_file="$(pwd)/src/monitor/Monitor.py"
check_restart_file="$(pwd)/src/monitor/check_restart.py"

mkdir jobs
# check and create
Expand Down Expand Up @@ -39,12 +40,14 @@ crontab -l > temp_crontab
#echo new cron into cron file
if [ "$(grep "${monitor_program_file}" temp_crontab)" == "" ]; then
echo "*/30 * * * * python3 ${monitor_program_file}" >> temp_crontab

#install new cron file
crontab temp_crontab
fi
rm temp_crontab

if [ "$(grep "${check_restart_file}" temp_crontab)" == "" ]; then
echo "@reboot python3 ${check_restart_file}" >> temp_crontab
fi

crontab temp_crontab
rm temp_crontab

#====================================================
# Install package and images
Expand Down
Loading

0 comments on commit d74b56e

Please sign in to comment.