#!/bin/sh /sbin/openvpn_init.sh & # /config is usually a mounted volume; make sure the deluge user can write to it chown -R deluge:deluge /config # Starting before the tunnel is up makes the first announces and DHT bootstrap fail echo "waiting for ${VPN_DEV:-tun0}" until ip -4 addr show dev "${VPN_DEV:-tun0}" 2>/dev/null | grep -q inet; do sleep 1 done if [ "${PIA_PORT_FORWARD:-true}" = "true" ]; then /sbin/pia_port_forward.sh & fi echo starting deluge on port $PORT su deluge bash -c "deluged -c /config -d -p $PORT -u 0.0.0.0"