diff --git a/root/etc/deluge/stop.sh b/root/etc/deluge/stop.sh index efb4083ed..942833255 100755 --- a/root/etc/deluge/stop.sh +++ b/root/etc/deluge/stop.sh @@ -2,7 +2,7 @@ TIMESTAMP_FORMAT='%a %b %d %T %Y' log() { - echo "$(date +"${TIMESTAMP_FORMAT}") [tunnel-up] $*" + echo "$(date +"${TIMESTAMP_FORMAT}") [tunnel-down] $*" } # If deluge-pre-stop.sh exists, run it @@ -15,7 +15,7 @@ fi echo "Sending kill signal to deluge-daemon" PID=$(pidof deluged) -kill $PID +kill -9 $PID # Give deluge-daemon time to shut down for i in {1..10}; do ps -p $PID &> /dev/null || break diff --git a/root/etc/openvpn/tunnelDown.sh b/root/etc/openvpn/tunnelDown.sh index 6186eadda..cc33460a7 100755 --- a/root/etc/openvpn/tunnelDown.sh +++ b/root/etc/openvpn/tunnelDown.sh @@ -1,3 +1,10 @@ #!/bin/bash -/etc/deluge/stop.sh +if [ "${PEER_DNS}" != "no" ]; then + if [ -e /etc/resolv.conf-"${dev}".sv ] ; then + cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf + fi + chmod 644 /etc/resolv.conf +fi + +/etc/deluge/stop.sh "$@"