File: netscript.ppp.ip-down

package info (click to toggle)
netscript-2.4 5.5.5%2Bnmu3
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: sh: 2,166; makefile: 86
file content (29 lines) | stat: -rwxr-xr-x 670 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
[ ! -x /bin/ip ] && exit 0
[ ! -x /usr/sbin/netscript ] && exit 0

qt () { "$@" >/dev/null 2>&1 ; }
vb () { "$@" ; }
source () { . $1 ; }
basename () { echo "${1##*/}"; }

. /etc/netscript/if.conf
. /etc/netscript/network.conf
. /etc/netscript/qos.conf

REV_PPP_CHAIN=''
IF_NODASH=`echo "$PPP_IFACE" | sed -e 's/\-/_/g'`
eval PPP_CHAIN=\"\${"${IF_NODASH}"_PPP_CHAIN:-""}\"
eval PPP_CHAIN_AUTO=\"\${"${IF_NODASH}"_PPP_CHAIN_AUTO:-""}\"
PPP_CHAIN="$PPP_CHAIN_AUTO $PPP_CHAIN" 
for IF in $PPP_CHAIN; do
	REV_PPP_CHAIN="$REV_PPP_CHAIN $IF"
done
unset IF
for IF in $REV_PPP_CHAIN; do
	if_down $IF
done
unset IF

[ ! -x /sbin/tc ] && exit 0
ip_QoSclear $PPP_IFACE