#!/bin/sh #set -x # # Variables Section #============================================================== # list process to monitor in the variable below. #{wazapp} /usr/bin/python /opt/waxmppplugin/bin/wazapp/ PROGRAM1="wazapp" #lists pid of that process PID1=$(pidof $PROGRAM1) # # #================================================================== # The ‘if’ statement below checks to see if the process is running # with the ‘ps’ command. If the value is returned as a ’0' then # an email will be sent and the process will be safely restarted. # if [ $PID1 = '' ]; then /opt/waxmppplugin/bin/wazapp/wazapp else echo 'Wazapp is running' fi exit