Skip to content

Instantly share code, notes, and snippets.

@i-sync
Created August 10, 2017 05:22
Show Gist options
  • Save i-sync/3b30ce7d7ac9a3f809a2e9ad772ae1a0 to your computer and use it in GitHub Desktop.
Save i-sync/3b30ce7d7ac9a3f809a2e9ad772ae1a0 to your computer and use it in GitHub Desktop.
frpc auto start script
#!/bin/sh
LOGTIME=$(date "+%F %T")
PRO_NAME=frpc
NUM=$(ps | grep $PRO_NAME | grep -v grep |wc -l)
#echo $NUM >> /tmp/frp.log
if [ "${NUM}" -lt "1" ];then
echo $LOGTIME $PRO_NAME is stop, restarting.... >> /tmp/frp.log
/home/pi/frp/frpc -c /home/pi/frp/frpc.ini -L /home/pi/frp/frpc.log &
else
echo $LOGTIME $PRO_NAME is running! >> /tmp/frp.log
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment