Add NET_IF_BASE for centos script
This commit is contained in:
parent
9a52f8e584
commit
10ee166a40
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user