Add check for network interface eth0
This commit is contained in:
parent
7ca9723e45
commit
9609b0b7b5
@ -49,6 +49,12 @@ if [ "$(id -u)" != 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure "eth0" is available
|
||||
if [ ! -f /sys/class/net/eth0/operstate ]; then
|
||||
echo "Network interface 'eth0' is not available. Aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for empty VPN variables
|
||||
if [ -z "$IPSEC_PSK" ] || [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ]; then
|
||||
echo "The VPN credentials cannot be empty. Please re-edit the VPN script."
|
||||
|
@ -58,6 +58,15 @@ if [ "$(id -u)" != 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure "eth0" is available
|
||||
if [ ! -f /sys/class/net/eth0/operstate ]; then
|
||||
echo "Network interface 'eth0' is not available. Aborting."
|
||||
echo
|
||||
echo "CentOS 7 users should change interfaces to use the old naming convention"
|
||||
echo "before running this script. See: https://wiki.centos.org/FAQ/CentOS7"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for empty VPN variables
|
||||
if [ -z "$IPSEC_PSK" ] || [ -z "$VPN_USER" ] || [ -z "$VPN_PASSWORD" ]; then
|
||||
echo "The VPN credentials cannot be empty. Please re-edit the VPN script."
|
||||
|
Loading…
x
Reference in New Issue
Block a user