mirror of
https://github.com/haugene/docker-transmission-openvpn.git
synced 2025-08-19 21:41:11 +02:00
Use DNS env var to being able to reach freevpn server to download zip file and get server's password, saved into a temp file.
This commit is contained in:
parent
a460c31eb4
commit
4ebf6bcfe9
@ -3,10 +3,22 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# docker exec -it -w / **CONTAINER** bash -c "./etc/openvn/updateFreeVPN.sh"
|
# docker exec -it -w / **CONTAINER** bash -c "./etc/openvn/updateFreeVPN.sh"
|
||||||
|
|
||||||
DOMAIN=${OPENVPN_CONFIG%%-*}
|
# Use DNS env var to being able to connect to freevpn server removing
|
||||||
|
# the default content.
|
||||||
|
# DNS passed as command line argument or dockerfile doesn't work
|
||||||
|
echo "nameserver ${DNS}" > /etc/resolv.conf
|
||||||
|
|
||||||
|
# Debug purpose
|
||||||
|
# ping freevpn.me -c 4
|
||||||
|
|
||||||
|
DOMAIN=${OPENVPN_CONFIG%%-*}
|
||||||
OPENVPN_IP=$(curl -s https://freevpn.${DOMAIN}/accounts/ | grep IP | sed s/"^.*IP\:.... "/""/g | sed s/"<.*"/""/g)
|
OPENVPN_IP=$(curl -s https://freevpn.${DOMAIN}/accounts/ | grep IP | sed s/"^.*IP\:.... "/""/g | sed s/"<.*"/""/g)
|
||||||
|
|
||||||
|
# freevpn.me , main server, presents two servers with different address
|
||||||
|
# and related password to be used
|
||||||
SERVER=${OPENVPN_IP%".freevpn.${DOMAIN}"}
|
SERVER=${OPENVPN_IP%".freevpn.${DOMAIN}"}
|
||||||
|
PASSWORD=$(curl -s https://freevpn.${DOMAIN}/accounts/ | grep Password | sed s/"^.*Password\:.... "/""/g | sed s/"<.*"/""/g)
|
||||||
|
echo "${PASSWORD}" > /etc/freevpn_password
|
||||||
|
|
||||||
DIR="/tmp/freevpn"
|
DIR="/tmp/freevpn"
|
||||||
TARGET="/etc/openvpn/freevpn"
|
TARGET="/etc/openvpn/freevpn"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user