diff --git a/root/etc/deluge/start.sh b/root/etc/deluge/start.sh index 9c85bf01a5..93e136a91b 100755 --- a/root/etc/deluge/start.sh +++ b/root/etc/deluge/start.sh @@ -69,7 +69,15 @@ if [[ -n "${LOCAL_NETWORK-}" ]]; then fi fi -ufw status +# check if ufw is disabled (re-enable it) +if [[ "${ENABLE_UFW,,}" == "true" ]]; then + ufw status | grep -qw active + if [[ "$?" != "0" ]]; then + log "Re-enabling ufw" + ufw enable + ufw status + fi +fi log "Starting Deluge" exec su --preserve-environment abc -s /bin/bash -c "/usr/bin/deluged -d -c /config -L info -l /config/deluged.log" & diff --git a/root/etc/deluge/stop.sh b/root/etc/deluge/stop.sh index 6f5665ab75..724dd2fa67 100755 --- a/root/etc/deluge/stop.sh +++ b/root/etc/deluge/stop.sh @@ -14,7 +14,7 @@ then fi log "Sending kill signal to deluge-daemon" -PID=$(pidof deluged) +PID=$(pidof /usr/bin/python3 /usr/bin/deluged) kill -9 $PID # Give deluge-daemon time to shut down for i in {1..10}; do @@ -29,3 +29,5 @@ then /config/deluge-post-stop.sh "$@" log "/config/deluge-post-stop.sh returned $?" fi + +exec /etc/ufw/disable.sh \ No newline at end of file diff --git a/root/etc/openvpn/init.sh b/root/etc/openvpn/init.sh index 9745aa176a..a32da767bd 100755 --- a/root/etc/openvpn/init.sh +++ b/root/etc/openvpn/init.sh @@ -200,7 +200,7 @@ if [[ "true" = "${ENABLE_UFW}" ]]; then /etc/ufw/enable.sh tun0 ${CHOSEN_OPENVPN_CONFIG} fi -DELUGE_CONTROL_OPTS="--script-security 2 --up-delay --up /etc/openvpn/tunnelUp.sh --down /etc/openvpn/tunnelDown.sh" +DELUGE_CONTROL_OPTS="--script-security 2 --auth-nocache --up-delay --up /etc/openvpn/tunnelUp.sh --down /etc/openvpn/tunnelDown.sh" # shellcheck disable=SC2086 log "Starting openvpn" diff --git a/root/etc/ufw/disable.sh b/root/etc/ufw/disable.sh old mode 100644 new mode 100755 index a64ac3a7f6..5b430e1aa1 --- a/root/etc/ufw/disable.sh +++ b/root/etc/ufw/disable.sh @@ -6,9 +6,7 @@ TIMESTAMP_FORMAT='%a %b %d %T %Y' log() { echo "$(date +"${TIMESTAMP_FORMAT}") [ufw-disable] $*" } -# Source our persisted env variables from container startup -. /etc/deluge/environment-variables.sh -ufw reset +log "Disabling ufw" ufw disable ufw status \ No newline at end of file