diff --git a/hangover.sh b/hangover.sh index 800a182..df71ed7 100755 --- a/hangover.sh +++ b/hangover.sh @@ -1,10 +1,21 @@ #!/bin/sh -e +# Get User +USER=whoami + # Exit early if any session with my username is found if who | grep -wq $USER; then exit fi +# Get user home path and username +PATH=~ + +# 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 MY_NUMBER='+xxx' NUMBER_OF_BOSS='+xxx' diff --git a/smack-my-bitch-up.sh b/smack-my-bitch-up.sh index cc0547c..8391708 100755 --- a/smack-my-bitch-up.sh +++ b/smack-my-bitch-up.sh @@ -1,10 +1,21 @@ #!/bin/sh -e +# Get User +USER=whoami + # Exit early if no sessions with my username are found if ! who | grep -wq $USER; then exit fi +# Get user home path and username +PATH=~ + +# Checks to see if job is in crontab already and if not updates cronto run the script only on weekdays @ 9:01pm +if ! crontab -u $USER -l | grep smack-my-bitch-up.sh then + echo "01 9 * * 1-5 $PATH/smack-my-bitch-up.sh" >> /etc/crontab +fi + # Phone numbers MY_NUMBER='+xxx' HER_NUMBER='+xxx'