Skip to content

Instantly share code, notes, and snippets.

Last active June 17, 2018 09:18
What would you like to do?
Script for sending sms on server start
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"
echo $msg | /usr/local/bin/ $PHONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment