1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 03:34:48 +08:00

Add compatibility for ppp version 2.5.0 (#89)

Co-authored-by: long <gmchenlong@gmail.com>
This commit is contained in:
Long0x0 2023-10-08 01:27:06 +08:00 committed by GitHub
parent 3316d0fa01
commit 51ae7a6ceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,14 +143,18 @@ xl2tpd_waituser() {
fi
echo -n > $PPP_LOG_FILE
pid="/var/run/ppp-${LAC_NAME}.pid"
if [ -e $pid ]; then
ppp=$(cat $pid | grep ppp)
if ip addr show | grep "inet.*${ppp}" > /dev/null; then
ip addr show | grep "inet.*${ppp}" | sed 's/^ */[VPN] /'
return
for pid in "/var/run/ppp-${LAC_NAME}.pid" \
"/var/run/pppdppp-${LAC_NAME}.pid" \
"/var/run/pppd/ppp-${LAC_NAME}.pid"; do
if [ -e $pid ]; then
ppp=$(cat $pid | grep ppp)
if ip addr show | grep "inet.*${ppp}" > /dev/null; then
ip addr show | grep "inet.*${ppp}" | sed 's/^ */[VPN] /'
return
fi
break
fi
fi
done
done