Check if your bchange.sh is running?
Here is a script to check if bchange.sh script is running or not, if its running and user want to issue another one then it will kill the old one first before running a new one.
#!/bin/bash
SERVICE="bchange2.sh"
PATHSERV="/usr/local/bin"
if ps x | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE service running, killing it"
echo "Killing $SERVICE"
killall $SERVICE
killall sleep
$PATHSERV/$SERVICE
else
echo "$SERVICE is not running"
echo "Running new $SERViCE"
$PATHSERV/$SERVICE
fi
exit 0
-=end transmission=-


















Reader Comments