1
0
mirror of https://github.com/namibia/demo-sync.git synced 2024-11-22 03:25:09 +00:00

fixed the cron job function

This commit is contained in:
Llewellyn van der Merwe 2017-07-22 00:12:17 +01:00
parent dc08facf6d
commit da12949b2b
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5

View File

@ -85,12 +85,12 @@ function setCron () {
echo "" >> $VDMHOME/$ACTION.cron echo "" >> $VDMHOME/$ACTION.cron
fi fi
# check if the @reboot curl -s $VDMSCRIPT | sudo bash is already set # check if the @reboot curl -s $VDMSCRIPT | sudo bash is already set
if [[ $currentCron != *"@reboot curl -s $VDMSCRIPT $ACTION | sudo bash"* ]]; then if [[ $currentCron != *"@reboot curl -s $VDMSCRIPT | bash"* ]]; then
echo "@reboot curl -s $VDMSCRIPT $ACTION | sudo bash" >> $VDMHOME/$ACTION.cron echo "@reboot curl -s $VDMSCRIPT | bash" >> $VDMHOME/$ACTION.cron
fi fi
# check if the @reboot curl -s $VDMSCRIPT | sudo bash is already set # check if the @reboot curl -s $VDMSCRIPT | sudo bash is already set
if [[ $currentCron != *"*/7 * * * * curl -s $VDMSCRIPT $ACTION | sudo bash"* ]]; then if [[ $currentCron != *"*/5 * * * * curl -s $VDMSCRIPT | bash"* ]]; then
echo "*/7 * * * * curl -s $VDMSCRIPT $ACTION | sudo bash" >> $VDMHOME/$ACTION.cron echo "*/5 * * * * curl -s $VDMSCRIPT | bash" >> $VDMHOME/$ACTION.cron
fi fi
# set the user cron # set the user cron
crontab -u $VDMUSER $VDMHOME/$ACTION.cron crontab -u $VDMUSER $VDMHOME/$ACTION.cron