shadowsocks 守护进程

shadowsocks python版本运行一段时间后,莫名其妙的就GG了,所以写了个shell脚本,每隔一分钟检查一次进程,如果进程不存在就运行shadowsocks。

!/bin/bash
 守护进程
 res=ps -ef | grep "ssserver" | grep -v grep | wc -l
 if [ $res -eq 0 ]
 then
     ssserver -c /etc/shadowsocks.json -d start
 fi
 echo "  */1  *  *  *  *  root sh /home/root/guard_shadowsocks.sh" >> /etc/crontab

注意修改文件路径和文件名

Add a Comment

您的电子邮箱地址不会被公开。 必填项已用*标注