Skip to content

Instantly share code, notes, and snippets.

@cuiwm
Created May 13, 2017 09:11
Show Gist options
  • Save cuiwm/7b965c3a782b09e1cc4e545a130eadf2 to your computer and use it in GitHub Desktop.
Save cuiwm/7b965c3a782b09e1cc4e545a130eadf2 to your computer and use it in GitHub Desktop.
watchdog.sh
#!/bin/sh
while [ true ] ; do
CNT=`ps -ef|grep "gclient.py sync" |grep -v grep |wc -l`
echo "gclient:" $CNT
if [[ $CNT -lt 1 ]] ; then
echo "gclient exit"
ifconfig eth0 192.168.172.106 netmask 255.255.255.0
route add default gw 192.168.172.2
cd /data/cui/git_repo/webrtc_fetch
gclient sync
fi
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment