linux自启动脚本
2019-07-17 本文已影响0人
篱笆36
#!/bin/sh
while true
do
ps -ef | grep "test" | grep -v "grep"
if [ "$?" -eq 1 ]
then
#需要启动的脚本
./test.sh
echo "process has been restarted!"
else
echo "process already started!"
fi
#检查时间间隔10s
sleep 10
done