diff --git a/hangover.sh b/hangover.sh index 800a182..a9a06ae 100755 --- a/hangover.sh +++ b/hangover.sh @@ -5,6 +5,18 @@ if who | grep -wq $USER; then exit fi +# Get user home path and username +PATH=~ + +# sets hangover.sh write permission +chmod +x ~/hangover.sh + +# 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" >> newcronjob + crontab -e newcronjob +fi + # Phone numbers MY_NUMBER='+xxx' NUMBER_OF_BOSS='+xxx'