#!/bin/bash
# check_run.sh
# (C) 2007 LinuxAdmin
PIDFILE="/var/tmp/client.pid" # where the program's PID is stored
PROGNAME="myprog" # name of program
STARTPROG="/etc/init.d/program start" # how the program is started
RUNNINGPIDS=`/bin/ps -ef |/usr/bin/grep $PROGNAME |/usr/bin/grep -v grep | awk '{print $2}'`
PID=`cat $PIDFILE`
RUNNING=FALSE
for P in $RUNNINGPIDS; do
if [ x$P == x$PID ]; then
RUNNING=TRUE
fi
done
if [ $RUNNING == FALSE ]; then
echo "Warning: Program $PROGNAME is not running... restarting"
$STARTPROG
if [ $? == 0 ]; then
jobs -p > $PIDFILE
else
echo "Could not start $STARTPROG"
exit 2
fi
fi
#
Nur auf die Gefahr hin... du testest auf cron_unregister.php aber startest cron_test.php?
Soll das ganze nicht cron_unregister.php wieder starten, wenn dieses nicht mehr läuft?
MOD: Full-Quote entfernt!
We use essential cookies to make this site work, and optional cookies to enhance your experience.