驗證一個進程是否起來,沒有重啓的shell腳本

#!/bin/sh

#button
ps -fe|grep "button" |grep -v grep
if [ $? -ne 0 ]
then
echo "Create button process..."
	button &
else
	echo "button process has already running."
fi

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章