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
19 logger "Found no matching interface for DSL notification ($DSL_INTERFACE_STATUS)"
23 config_get default led_adsl default
24 if [ "$default" != 1 ]; then
25 case "$DSL_INTERFACE_STATUS" in
26 "HANDSHAKE") led_timer adsl 500 500;;
27 "TRAINING") led_timer adsl 200 200;;
33 local interfaces=`ubus list network.interface.\* | cut -d"." -f3`
35 for ifc in $interfaces; do
38 json_load "$(ifstatus $ifc)"
42 config_get_bool auto "$ifc" auto 1
45 json_get_var proto proto
47 if [ "$DSL_INTERFACE_STATUS" = "UP" ]; then
48 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$auto" = 1 ]; then
49 ( sleep 1; ifup "$ifc" ) &
52 if [ "$proto" = "pppoa" ] && [ "$up" = 1 ] && [ "$auto" = 1 ]; then
53 ( sleep 1; ifdown "$ifc" ) &
55 json_get_var autostart autostart
56 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$autostart" = 1 ]; then
57 ( sleep 1; ifdown "$ifc" ) &