检测服务进程脚本
Aria2c经常崩溃,所以使用一个脚本每秒检测Aria2c是否运行,如果没有,则延时10秒重启Aria2c. #!/bin/bash ps_out=`ps -ef | grep $1 | grep -v 'grep' | grep -v $0` result=$(echo $ps_out | grep "$1") if [[ "$result" != "" ]];then echo "Service Running" else echo "Serivce Not Running" fi 检测Aria2c: $./check.sh aria2c 自动检测重启Aria2c: #!/bin/bash ps_out=`ps -ef | grep $1 | grep…