Skip to content

Instantly share code, notes, and snippets.

@void285
Created April 26, 2020 13:33
Show Gist options
  • Save void285/8e4bff158aed431d6e50cc32c3d06cca to your computer and use it in GitHub Desktop.
Save void285/8e4bff158aed431d6e50cc32c3d06cca to your computer and use it in GitHub Desktop.
restart process if down on openwrt
cnt=`ps | grep "kcptun" | grep -v "grep" | wc -l`
if [ $cnt -eq 0 ];then
/usr/bin/kcptun-client -c /var/etc/kcptun/client.general.json
echo "restart kcptun service at `date`" >> /root/check.log
else
echo "$cnt kcptun service on at `date`"
fi
# add this line to cron with `crontab -e`
# * * * * * /root/openwrt_process_watchdog.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment