1
0
mirror of synced 2025-01-31 04:21:43 +03:00

Add check for network interface eth0

This commit is contained in:
hwdsl2 2016-01-19 01:26:12 -06:00
parent 7ca9723e45
commit 9609b0b7b5
2 changed files with 15 additions and 0 deletions

View File

@ -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."

View File

@ -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."