1
0
mirror of synced 2025-02-16 20:13:19 +03:00

Add NET_IF_BASE for centos script

This commit is contained in:
Jonathan Almeida 2017-04-29 22:07:26 -04:00 committed by GitHub
parent 9a52f8e584
commit 10ee166a40

View File

@ -60,8 +60,9 @@ if [ "$(id -u)" != 0 ]; then
exiterr "Script must be run as root. Try 'sudo sh $0'"
fi
NET_IF0=${VPN_IFACE:-'eth0'}
NET_IFS=${VPN_IFACE:-'eth+'}
NET_IF_BASE='eth'
NET_IF0=${VPN_IFACE:-NET_IF_BASE'0'}
NET_IFS=${VPN_IFACE:-NET_IF_BASE'+'}
if_state=$(cat "/sys/class/net/$NET_IF0/operstate" 2>/dev/null)
if [ -z "$if_state" ] || [ "$if_state" = "down" ] || [ "$NET_IF0" = "lo" ]; then
printf "Error: Network interface '%s' is not available.\n" "$NET_IF0" >&2