Script for sending sms on server start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
msg="$SERVER has started." | |
shutdown_dt=$(last -x --time-format iso |grep shutdown | head -n 1 | awk '{print $7}') | |
if [ -n "$shutdown_dt" ]; then | |
msg="$msg Shutdown at $shutdown_dt" | |
fi | |
echo $msg | /usr/local/bin/send-sms.sh $PHONE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment