Skip to content

Commit

Permalink
Fixed Network Interface validation
Browse files Browse the repository at this point in the history
The file "operstate" can have on of the following status: "up", "down", "unknown" ... etc. Therefore, the current condition is always false.
  • Loading branch information
Emirati authored Mar 30, 2017
1 parent 10e46fc commit c1dc0c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ -z "$VPN_NETWORK_INTERFACE" ]; then
VPN_NETWORK_INTERFACE="eth0"
fi

if [ `cat /sys/class/net/$VPN_NETWORK_INTERFACE/operstate` != "1" ]; then
if [ `cat /sys/class/net/$VPN_NETWORK_INTERFACE/operstate` != "up" ]; then
echo "Network interface '$VPN_NETWORK_INTERFACE' is not available. Aborting."
exit 1
fi
Expand Down

0 comments on commit c1dc0c8

Please sign in to comment.