All pastes #286530 Raw Edit

mezoko

public shellscript v1 · immutable
#286530 ·published 2006-12-20 19:24 UTC
rendered paste body
#!/bin/bashecho "This script will do the wonders of ping tboz.net"success=0while true; doif ((success==10)); then        echo "End Program"        subject="\"PING WORKED @ `date '+%r'`\""        echo "Pinged tboz.net on:" `date '+%D'` "at" `date '+%r'`|mail -s "$subject" offroadredneck@gmail.com        breakfi#ping -c 2 blah -q >/dev/null 2>&1#ping -c 2 dsl.sbc.yahoo.com -q >/dev/null 2>&1ping -c 2 tboz.net -q >/dev/null 2>&1#ping -c 2 mezoko.net -q >/dev/nul 2>&1if [[ $? == 0 ]]; then        echo "We could ping tboz.net";        #subject="\"PING WORKED @ `date '+%r'`\""        #echo "Pinged tboz.net on:" `date '+%D'` "at" `date '+%r'`|mail -s "$subject" offroadredneck@gmail.com        success=$[$success+1]elif  [[ $? != 0 ]]; then        echo "No Luck"        success=0        #subject="\"PING FAILED @ `date '+%r'`\""        #echo "Could not ping dsl.sbc.yahoo on:" `date '+%D'` "at" `date '+%r'`|mail -s "$subject" mezokoelse        echo "No luck"        success=0        #subject="\"PING had problem @ `date '+%r'`\""        #echo "Problem pinging dsl.sbc.yahoo on:" `date '+%D'` "at" `date '+%r'`|mail -s "$subject" mezokofisleep 15;done