iro/merlin
author Sandro Knauß <knauss@netzguerilla.net>
Sun, 18 Dec 2011 11:49:46 +0100
branchdevel
changeset 77 7dce6c0f06fb
parent 0 a3b6e531f0d2
permissions -rwxr-xr-x
adding database schema to documentation.

#!/bin/bash
#
# merlin commando
#
# eine überprüfung auf korrekten aufruf findet nicht statt
#
# beispiel:
#
#       ./merlin ./arthur
#
#               startet programm arthur und wenn er stirbt, wird er sofort
#               wiederbelebt.
#               harmlose magie halt... :-)
#
LOG=/home/sandy/var/log/merlin_Iro.log
while : ; do
	echo -n "$(date +'%F %T %Z') " >> $LOG
	$1 status >> $LOG
	if [ $? -eq 1 ]; then
		echo $(date +'%F %T %Z') $1 neustarten >> $LOG
		$1 start >> $LOG
	fi
	sleep 60
done