Hello All,
I have written a script which will check whether webiopi is running or not.
If its not running it will restart webiopi.
Problem: When i manually kill the webiopi application to check the script webiopi gets started executes for few seconds and gets restarted again and again in loop.
The script is as follows:
!/bin/bash
sleep 60
id=$(pgrep webiopi)
for((; ; ))
do
echo id = $id
echo len = ${#id}
if [ ${#id} = 0 ]
then
killall webiopi
webiopi
sleep 20
fi
id=$(pgrep webiopi)
done