Skip to content

Commit

Permalink
Removed Port Forwarding Double Check
Browse files Browse the repository at this point in the history
Due to an unknown @fsockopen bug (maybe error 111), this caused the script to display a "closed" status which forced the script to kill the VPN connection.

NOTICE: For now, the double check is off. Although, for those running repair though the task scheduler every XX minutes, it will still check the port forwarding status.
  • Loading branch information
mrjackyliang committed Apr 19, 2016
1 parent a054149 commit d6bf5da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions transmissionVPN/transmissionvpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ repair)
# Redefine variables
VPN_ADDR=`ifconfig $VPN_INTERFACE | grep 'inet addr:' | cut -d: -f2 | awk '{print $1}'`
VPN_RESP=`curl -sS --interface $VPN_INTERFACE $IP_CHECK`
VPN_PORT=`php -n portforward.php $VPN_ADDR $PORT_FWD`
#VPN_PORT=`php -n portforward.php $VPN_ADDR $PORT_FWD`

# Redefine variables if empty (bugfix)
if [ "$VPN_ADDR" = "" ] || [ "$VPN_RESP" = "" ]; then
Expand All @@ -178,13 +178,15 @@ repair)
# Display both IP addresses
echo "Interface IP is "$VPN_ADDR
echo "ipinfo.io IP is "$VPN_RESP
echo "Network Port is "$VPN_PORT
#echo "Network Port is "$VPN_PORT

# Checks VPN connection
if [ "$VPN_ADDR" != "$VPN_RESP" ] || [ "$VPN_PORT" == "closed" ]; then
#if [ "$VPN_ADDR" != "$VPN_RESP" ] || [ "$VPN_PORT" == "closed" ]; then
if [ "$VPN_ADDR" != "$VPN_RESP" ]; then

# Show Message
echo "ERROR 1002: VPN cannot connect to the internet or "$PORT_FWD" port is closed."
#echo "ERROR 1002: VPN cannot connect to the internet or "$PORT_FWD" port is closed."
echo "ERROR 1002: VPN cannot connect to the internet."

# Kill VPN connection
synovpnc kill_client
Expand Down

0 comments on commit d6bf5da

Please sign in to comment.