From b8e6ebd8c6e95e60126efa720222ab05609a631a Mon Sep 17 00:00:00 2001 From: binhex Date: Thu, 2 May 2019 17:08:20 +0100 Subject: [PATCH] privoxy checks now in watchdog --- run/nobody/watchdog.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/run/nobody/watchdog.sh b/run/nobody/watchdog.sh index 89a8d24..9e3f778 100644 --- a/run/nobody/watchdog.sh +++ b/run/nobody/watchdog.sh @@ -35,6 +35,7 @@ while true; do # reset triggers to negative values qbittorrent_running="false" + privoxy_running="false" ip_change="false" port_change="false" @@ -71,6 +72,22 @@ while true; do fi + if [[ "${ENABLE_PRIVOXY}" == "yes" ]]; then + + # check if privoxy is running, if not then skip shutdown of process + if ! pgrep -fa "privoxy" > /dev/null; then + + echo "[info] Privoxy not running" + + else + + # mark as privoxy as running + privoxy_running="true" + + fi + + fi + # run scripts to identify external ip address source /home/nobody/getvpnextip.sh @@ -126,6 +143,17 @@ while true; do fi + if [[ "${ENABLE_PRIVOXY}" == "yes" ]]; then + + if [[ "${privoxy_running}" == "false" ]]; then + + # run script to start privoxy + source /home/nobody/privoxy.sh + + fi + + fi + else echo "[warn] VPN IP not detected, VPN tunnel maybe down" @@ -144,6 +172,20 @@ while true; do fi + if [[ "${ENABLE_PRIVOXY}" == "yes" ]]; then + + # check if privoxy is running, if not then start via privoxy.sh + if ! pgrep -fa "privoxy" > /dev/null; then + + echo "[info] Privoxy not running" + + # run script to start privoxy + source /home/nobody/privoxy.sh + + fi + + fi + fi if [[ "${DEBUG}" == "true" && "${VPN_ENABLED}" == "yes" ]]; then