39 lines
813 B
Bash
Executable File
39 lines
813 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This script is run by pppd when ppp link fails to established.
|
|
|
|
# Environnement variables:
|
|
|
|
# IFNAME: $1, interface name (pppi)
|
|
# DEVICE: $2, device name (atmi)
|
|
|
|
# retain only characters after / (/dev/ttyUSB0)
|
|
|
|
IFNAME=${1:-}
|
|
DEVICE=${2:-}
|
|
DEVICE=${DEVICE##*/}
|
|
|
|
# for ppp over vpn DEVICE is empty
|
|
[ "$DEVICE" = '' ] && DEVICE=$IFNAME
|
|
|
|
. /etc/bewan/scripts/globals
|
|
. /etc/bewan/lib/base
|
|
|
|
base_log "$SCRIPTD/ppp-fail6 $DEVICE" debug
|
|
|
|
# Take wan-up-down mutex
|
|
base_enter_critical 'wan-up-down'
|
|
|
|
# Get config parameters after taking lock
|
|
base_call_initd 'setparam'
|
|
|
|
if [ -f "$INTFD/$DEVICE/wanid" ]; then
|
|
WANID=`cat $INTFD/$DEVICE/wanid`
|
|
# ip-fail6 wants this variable to be set
|
|
local IFFLAGS=
|
|
base_call_scripts 'ip-fail6'
|
|
fi
|
|
|
|
# Release wan-up-down mutex
|
|
base_exit_critical 'wan-up-down'
|