Skip to content

Commit

Permalink
privoxy checks now in watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
binhex committed May 2, 2019
1 parent 085bc8c commit a013b6f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions run/nobody/watchdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ while true; do

# reset triggers to negative values
sabnzbd_running="false"
privoxy_running="false"
ip_change="false"

if [[ "${VPN_ENABLED}" == "yes" ]]; then
Expand All @@ -27,13 +28,41 @@ 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

if [[ "${sabnzbd_running}" == "false" ]]; then

# run script to start sabnzbd
source /home/nobody/sabnzbd.sh

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"
Expand All @@ -52,6 +81,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
Expand Down

0 comments on commit a013b6f

Please sign in to comment.