Created
September 15, 2020 04:18
-
-
Save thrnz/dcbaa0af66c70af8e302a1c7eb75484a to your computer and use it in GitHub Desktop.
Helper container to pass forwarded port to Deluge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \ | |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && \ | |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \ | |
apk add --no-cache bash deluge | |
ADD pia-port.sh /scripts/pia-port.sh | |
RUN chmod +x /scripts/*.sh | |
CMD ["/scripts/pia-port.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap 'exit 0' SIGTERM | |
OLDPORT=0 | |
PORT=0 | |
while true | |
do | |
[ -r "/pia-shared/port.dat" ] && PORT=$(cat /pia-shared/port.dat) | |
if [ $OLDPORT -ne $PORT ]; then | |
echo "Setting Deluge port settings ($PORT)..." | |
deluge-console --config=/deluge/conf "config --set listen_ports ($PORT,$PORT)" | |
OLDPORT=$PORT | |
fi | |
sleep 30 & | |
wait $! | |
done |
Did someone already publish this to ghcr.io
or Docker Hub?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you @andrewfraley this
apk upgrade musl
saved me!