Commit | Line | Data |
---|---|---|
1 | #!/bin/bash | |
2 | ||
3 | # Pass one command-line argument: the URL to try retrieving to see if Apache is working | |
4 | ||
5 | if wget -q -t 1 -O /dev/null -T 5 $1; then | |
6 | echo "No problem" >/dev/null | |
7 | else | |
8 | /etc/init.d/apache2 restart | |
9 | echo "It seemed to be down at `date`." | mail -s "Apache restarted on `hostname`" admins@hcoop.net | |
10 | fi |