Skip to content

Instantly share code, notes, and snippets.

@stesh
Created November 3, 2011 15:17
Show Gist options
  • Save stesh/1336748 to your computer and use it in GitHub Desktop.
Save stesh/1336748 to your computer and use it in GitHub Desktop.
( [ -f /var/run/lighttpd.pid ] && [ $(pgrep lighttpd | head -n 1) = $(head -n 1 /var/run/lighttpd.pid) ] ) || (
/etc/init.d/lighttpd restart
echo \
"To: webmaster@netsoc.tcd.ie
From: root@cubewww.netsoc.tcd.ie
Subject: Automated restart of lighttpd
Attempted automated restart of lighttpd on $(date)
" | sendmail "webmaster@netsoc.tcd.ie"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment