Skip to content

Commit

Permalink
Removed Port Forwarding Check
Browse files Browse the repository at this point in the history
Second check only, First check still exists
  • Loading branch information
mrjackyliang committed Apr 19, 2016
1 parent d6bf5da commit 2d10995
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
30 changes: 15 additions & 15 deletions transmissionVPN/portforward.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php /* Port Forwarding Check for transmissionVPN
------------------------------------------------------- */
$host = $argv[1];
$port = $argv[2];
$connection = @fsockopen($host, $port, $errno, $errstr, 10);
if(is_resource($connection)) {
echo 'open' . "\n";
fclose($connection);
} elseif(empty($port)) {
echo 'empty' . "\n";
} else {
echo 'closed' . "\n";
}
------------------------------------------------------- */
$host = $argv[1];
$port = $argv[2];
$connection = @fsockopen($host, $port, $errno, $errstr, 10);
if(is_resource($connection)) {
echo 'open' . "\n";
fclose($connection);
} elseif(empty($port)) {
echo 'empty' . "\n";
} else {
echo 'closed' . "\n";
}
4 changes: 0 additions & 4 deletions transmissionVPN/transmissionvpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ 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`

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

# Checks VPN connection
#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."

# Kill VPN connection
Expand Down

0 comments on commit 2d10995

Please sign in to comment.