#!/bin/sh
while true
do
ps -ef|grep "test"|grep -v "grep"
if["$?"-eq 1]
then
nohup ./test &
echo "process has been restarted!"
else
echo "process already started!"
fi
sleep 10
done
#!/bin/sh
while true
do
ps -ef|grep "test"|grep -v "grep"
if["$?"-eq 1]
then
nohup ./test &
echo "process has been restarted!"
else
echo "process already started!"
fi
sleep 10
done