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
21 config_get default led_adsl default
22 if [ "$default" != 1 ]; then
23 case "$DSL_INTERFACE_STATUS" in
24 "HANDSHAKE") led_timer adsl
500 500;;
25 "TRAINING") led_timer adsl
200 200;;
31 local interfaces
=`ubus list network.interface.\* | cut -d"." -f3`
33 for ifc
in $interfaces; do
36 json_load
"$(ifstatus $ifc)"
40 config_get_bool auto
"$ifc" auto
1
43 json_get_var proto proto
45 if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then
46 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$auto" = 1 ]; then
47 ( sleep 1; ifup
"$ifc" ) &
50 if [ "$proto" = "pppoa" ] && [ "$up" = 1 ] && [ "$auto" = 1 ]; then
51 ( sleep 1; ifdown
"$ifc" ) &
53 json_get_var autostart autostart
54 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$autostart" = 1 ]; then
55 ( sleep 1; ifdown
"$ifc" ) &