4fd9b9c66224662586401e8d39f4ca6dbc085e48
[openwrt.git] / package / ppp / files.old / etc / hotplug.d / atm / 20-atm-modem
1 #!/bin/sh
2
3 if [ "$ACTION" = "add" ]; then
4         include /lib/network
5         scan_interfaces
6
7         local found=0
8         local ifc
9         for ifc in $interfaces; do
10                 local up
11                 config_get_bool up "$ifc" up 0
12
13                 local auto
14                 config_get_bool auto "$ifc" auto 1
15
16                 local proto
17                 config_get proto "$ifc" proto
18
19                 if [ "$proto" = "pppoa" ] && [ "$up" != 1 ] && [ "$auto" = 1 ]; then
20                         found=1
21                         ( sleep 1; ifup "$ifc" ) &
22                 fi
23         done
24
25         if [ "$found" != 1 ]; then
26                 logger "Found no matching interface for DSL device $DEVICENAME"
27         fi
28 fi