msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

18 Feb 2008 Restart dead daemon automatically

Posted by

This is a simple bash script to restart a dead daemon, in this example I’ll use apache

#!/bin/bash

# Automatically restart httpd if it dies
netstat -ln | grep ":80 " | wc -l | awk '{if ($1 == 0) system("/etc/init.d/httpd restart") }'

Tags:

Comments are closed.