-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
additional logging for incoming port on downloader
- Loading branch information
Showing
1 changed file
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
#!/bin/bash | ||
|
||
while [ ! -f /home/nobody/vpn_incoming_port.txt ] | ||
vpn_port="/home/nobody/vpn_incoming_port.txt" | ||
|
||
echo "[info] Waiting for file '${vpn_port}' to be generated (contains PIA API generated incoming port number)..." | ||
while [ ! -f "${vpn_port}" ] | ||
do | ||
sleep 0.1s | ||
done | ||
|
||
# get port number assigned from pia's api (file contents generated by /root/getvpnport.sh) | ||
VPN_INCOMING_PORT=$(</home/nobody/vpn_incoming_port.txt) | ||
VPN_INCOMING_PORT=$(<"${vpn_port}") | ||
|
||
if [[ -z "${VPN_INCOMING_PORT}" ]]; then | ||
echo "[warn] Port forwarding is already activated on this connection, has expired, or you are NOT connected to a PIA region that supports port forwarding" | ||
else | ||
if [[ "${DEBUG}" == "true" ]]; then | ||
echo "[debug] Incoming port for tunnel is '${VPN_INCOMING_PORT}'" | ||
fi | ||
if [[ "${DEBUG}" == "true" ]]; then | ||
echo "[debug] Incoming port for tunnel is '${VPN_INCOMING_PORT}'" | ||
fi |