Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Update chkppp.sh
Browse files Browse the repository at this point in the history
grep -E '^auto.*lcwa.*$|^auto.*provider.*$' /etc/network/interfaces
  • Loading branch information
gharris999 authored Jan 26, 2022
1 parent 669df58 commit d85d285
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/chkppp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d85d285

Please sign in to comment.