Skip to content

Instantly share code, notes, and snippets.

@muink
Forked from HackingGate/pcap-dnsproxy-watchdog.sh
Created December 6, 2019 11:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muink/be921eac5c95da698c96de1a56ddfbdb to your computer and use it in GitHub Desktop.
Save muink/be921eac5c95da698c96de1a56ddfbdb to your computer and use it in GitHub Desktop.
A watchdog for Pcap-DNSProxy on OpenWrt
PROG=/usr/sbin/Pcap_DNSProxy
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
if [ $(ps|grep ${PROG}|grep -v grep|wc -l) -ge 1 ]; then
echo "['$LOGTIME'] Pcap_DNSProxy is running, PID is $(pidof ${PROG##*/})"
else
echo "['$LOGTIME'] Pcap_DNSProxy is not running."
/etc/init.d/pcap-dnsproxy start
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment