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
17 case "$(config_get led_dsl trigger)" in
19 led_set_attr
$1 "trigger" "netdev"
20 led_set_attr
$1 "device_name" "$(config_get led_dsl dev)"
21 led_set_attr
$1 "mode" "$(config_get led_dsl mode)"
33 config_get led led_dsl sysfs
34 if [ -n "$led" ]; then
35 case "$DSL_INTERFACE_STATUS" in
36 "HANDSHAKE") led_timer
$led 500 500;;
37 "TRAINING") led_timer
$led 200 200;;
38 "UP") led_dsl_up
$led;;
43 interfaces
=`ubus list network.interface.\* | cut -d"." -f3`
44 for ifc
in $interfaces; do
46 json_load
"$(ifstatus $ifc)"
48 json_get_var proto proto
49 if [ "$proto" != "pppoa" ]; then
54 config_get_bool auto
"$ifc" auto
1
55 if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then
56 if [ "$up" != 1 ] && [ "$auto" = 1 ]; then
57 ( sleep 1; ifup
"$ifc" ) &
60 if [ "$up" = 1 ] && [ "$auto" = 1 ]; then
61 ( sleep 1; ifdown
"$ifc" ) &
63 json_get_var autostart autostart
64 if [ "$up" != 1 ] && [ "$autostart" = 1 ]; then
65 ( sleep 1; ifdown
"$ifc" ) &