#!/bin/sh # Record exit status of emerge–must precede ALL other commands! [ $? -eq 0 ] && RESULT=”PASS” || RESULT=”FAIL” # Change next line to your mobile/SMS address SMS_ADDR=”2015551212@sms.some-mobile.com” LAST_PKG=”$(tac /var/log/emerge.log | awk ‘$2 == “>>>” {print $4,$5,$6,$7; exit;}’)” CFG_MODS=”$(find /etc -iname ‘._cfg????_*’ | wc -l)” mail -s”Emerge Completed” $SMS_ADDR <<-EOM ${RESULT} ${LAST_PKG} ::: ${CFG_MODS} config updates pending $* EOM