battery_nag, ensure 'killall battery_nag.sh' doesn't make the program think it's already running.
This commit is contained in:
@@ -7,9 +7,9 @@
|
|||||||
echo "`date` - Checking Active Programs"
|
echo "`date` - Checking Active Programs"
|
||||||
|
|
||||||
PID="$$"
|
PID="$$"
|
||||||
ps -ef | grep battery_nag.sh | grep -v $$ | grep -v grep
|
ps -ef | grep battery_nag.sh | grep -v grep | grep -v killall | grep -v $$
|
||||||
|
|
||||||
active=`ps -ef | grep battery_nag.sh | grep -v $$ | grep -vc grep`
|
active=`ps -ef | grep battery_nag.sh | grep -v grep | grep -v killall | grep -vc $$`
|
||||||
if (( "$active" >= 1 )); then
|
if (( "$active" >= 1 )); then
|
||||||
echo "Program already running, exiting. Number of processes: $active"
|
echo "Program already running, exiting. Number of processes: $active"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user