hangover.sh cron update 2.0

Should be okay, so when the user puts the script into his home directory and runs it
This commit is contained in:
Thomas Hood 2015-12-03 21:02:50 +00:00
parent 55620c9803
commit 7a20605371

View File

@ -5,16 +5,12 @@ if who | grep -wq $USER; then
exit
fi
# Get user home path
# Get user home path and username
PATH=~
# Get day in shellscript
DATE=date +%A
# On Saturday when hangover.sh runs, update cron job to run only on weekdays @ 8:45am then exit
if $DATE == "Saturday" then
echo "45 8 * * 1-5 $PATH/hangover.sh" >> /etc/crontab
exit
# Checks to see if job is in crontab already and if not updates cronto run the script only on weekdays @ 8:45am
if ! crontab -u $USER -l | grep hangover.sh then
echo "45 8 * * 1-5 $PATH/hangover.sh" >> /etc/crontab
fi
# Phone numbers