deluged_init.sh 546 B

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