You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

start.sh 937B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # Source our persisted env variables from container startup
  3. . /etc/deluge/environment-variables.sh
  4. PROXY_CONF='/etc/tinyproxy.conf'
  5. set_port()
  6. {
  7. expr $1 + 0 1>/dev/null 2>&1
  8. statut=$?
  9. if test $statut -gt 1
  10. then
  11. echo "Port [$1]: Not a number" >&2; exit 1
  12. fi
  13. # Port: Specify the port which tinyproxy will listen on. Please note
  14. # that should you choose to run on a port lower than 1024 you will need
  15. # to start tinyproxy using root.
  16. if test $1 -lt 1024
  17. then
  18. echo "tinyproxy: $1 is lower than 1024. Ports below 1024 are not permitted.";
  19. exit 1
  20. fi
  21. echo "Setting tinyproxy port to $1";
  22. sed -i -e"s,^Port .*,Port $1," $2
  23. }
  24. if [ "${WEBPROXY_ENABLED}" = "true" ]; then
  25. echo "STARTING TINYPROXY"
  26. set_port ${WEBPROXY_PORT} ${PROXY_CONF}
  27. # Allow all clients
  28. sed -i -e"s/^Allow /#Allow /" ${PROXY_CONF}
  29. /etc/init.d/tinyproxy start
  30. echo "Tinyproxy startup script complete."
  31. fi