3 # This script is called by dsl_cpe_control whenever there is a DSL event,
4 # we only actually care about the DSL_INTERFACE_STATUS events as these
5 # tell us the line has either come up or gone down.
7 # The rest of the code is basically the same at the atm hotplug code
10 [ "$DSL_NOTIFICATION_TYPE" = "DSL_INTERFACE_STATUS" ] ||
exit 0
12 .
/usr
/share
/libubox
/jshn.sh
14 .
/lib
/functions
/leds.sh
20 config_get led led_dsl sysfs
21 if [ -n "$led" ]; then
22 case "$DSL_INTERFACE_STATUS" in
23 "HANDSHAKE") led_timer
$led 500 500;;
24 "TRAINING") led_timer
$led 200 200;;
30 interfaces
=`ubus list network.interface.\* | cut -d"." -f3`
31 for ifc
in $interfaces; do
33 json_load
"$(ifstatus $ifc)"
36 config_get_bool auto
"$ifc" auto
1
38 json_get_var proto proto
40 if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then
41 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$auto" = 1 ]; then
42 ( sleep 1; ifup
"$ifc" ) &
45 if [ "$proto" = "pppoa" ] && [ "$up" = 1 ] && [ "$auto" = 1 ]; then
46 ( sleep 1; ifdown
"$ifc" ) &
48 json_get_var autostart autostart
49 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$autostart" = 1 ]; then
50 ( sleep 1; ifdown
"$ifc" ) &