From d85d2850e03516abcc866d1f2245a585b07fbfd2 Mon Sep 17 00:00:00 2001 From: Gordon Harris Date: Wed, 26 Jan 2022 12:56:25 -0700 Subject: [PATCH] Update chkppp.sh grep -E '^auto.*lcwa.*$|^auto.*provider.*$' /etc/network/interfaces --- scripts/chkppp.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/chkppp.sh b/scripts/chkppp.sh index 79c2ae4..406ac5a 100755 --- a/scripts/chkppp.sh +++ b/scripts/chkppp.sh @@ -5,9 +5,12 @@ SCRIPT_VERSION=20201206.165240 # Bash script to check to see if a pppoe connection is still up, and if not, re-establish it. # Get our PPPoE account name from /etc/network/interfaces -PPPOE_ACCOUNT="$(grep -E '^auto.*lcwa.*$' /etc/network/interfaces | awk '{ print $2 }')" +PPPOE_ACCOUNT="$(grep -E '^auto.*lcwa.*$|^auto.*provider.*$' /etc/network/interfaces | awk '{ print $2 }')" -[ -z "$PPPOE_ACCOUNT" ] && exit 1 +if [ -z "$PPPOE_ACCOUNT" ]; then + echo 'Error: No ppp interface defined in /etc/network/interfaces' + exit 1 +fi # Are we showing an active ppp interface? if [ $(ip -br a | grep -c -E '^ppp.*peer') -lt 1 ]; then