mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-14 23:43:56 +02:00
Added port forwarding, fixes #14
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
client_id=`head -n 100 /dev/urandom | sha256sum | tr -d " -"`
|
||||
json=`wget -qO- "http://209.222.18.222:2000/?client_id=$client_id" 2>/dev/null`
|
||||
if [ "$json" == "" ]; then
|
||||
printf "Port forwarding is already activated on this connection, has expired, or you are not connected to a PIA region that supports port forwarding\n"
|
||||
exit 1
|
||||
fi
|
||||
port=`echo $json | grep -Eo [0-9]{3,5}`
|
||||
ip=`wget -qO- https://diagnostic.opendns.com/myip`
|
||||
printf "Forwarded port for IP $ip is: $port\n"
|
||||
Reference in New Issue
Block a user