1
0
mirror of https://github.com/vdm-io/dynamic-ip.git synced 2024-12-05 00:33:13 +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
fi
# check if the @reboot curl -s $VDMSCRIPT | sudo bash is already set
if [[ $currentCron != *"@reboot curl -s $VDMSCRIPT $ACTION | sudo bash"* ]]; then
echo "@reboot curl -s $VDMSCRIPT $ACTION | sudo bash" >> $VDMHOME/$ACTION.cron
if [[ $currentCron != *"@reboot curl -s $VDMSCRIPT | bash"* ]]; then
echo "@reboot curl -s $VDMSCRIPT | bash" >> $VDMHOME/$ACTION.cron
fi
# check if the @reboot curl -s $VDMSCRIPT | sudo bash is already set
if [[ $currentCron != *"*/7 * * * * curl -s $VDMSCRIPT $ACTION | sudo bash"* ]]; then
echo "*/7 * * * * curl -s $VDMSCRIPT $ACTION | sudo bash" >> $VDMHOME/$ACTION.cron
if [[ $currentCron != *"*/5 * * * * curl -s $VDMSCRIPT | bash"* ]]; then
echo "*/5 * * * * curl -s $VDMSCRIPT | bash" >> $VDMHOME/$ACTION.cron
fi
# set the user cron
crontab -u $VDMUSER $VDMHOME/$ACTION.cron