brcm47xx: add initial support for devices with bcma bus.
[openwrt.git] / package / comgt / files / 3g.usb
1 #!/bin/sh
2
3 . /etc/functions.sh
4
5 log() {
6 logger -t 3g-hotplug "$@"
7 }
8
9 find_3g_iface() {
10 local cfg="$1"
11 local tty="$2"
12
13 local proto
14 config_get proto "$cfg" proto
15 [ "$proto" = 3g ] || return 0
16
17 local auto
18 config_get_bool auto "$cfg" auto 1
19 [ "$auto" = 1 ] || [ "$ACTION" = remove ] || return 0
20
21 local dev
22 config_get dev "$cfg" device
23
24 if [ "${dev##*/}" = "${tty##*/}" ]; then
25 if [ "$ACTION" = add ]; then
26 log "Starting interface $cfg for device ${dev##*/}"
27 ( sleep 1; /sbin/ifup "$cfg" ) &
28 else
29 log "Stopping interface $cfg for device ${dev##*/}"
30 /sbin/ifdown "$cfg" &
31 fi
32 fi
33 }
34
35 case "$DEVICENAME" in
36 tty*)
37 [ -e "/dev/$DEVICENAME" ] || [ "$ACTION" = remove ] || exit 0
38 config_load network
39 config_foreach find_3g_iface interface "/dev/$DEVICENAME"
40 ;;
41 esac
42
This page took 0.044296 seconds and 5 git commands to generate.