You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
577 B
34 lines
577 B
15 years ago
|
#!/bin/sh
|
||
|
. /etc/functions.sh
|
||
13 years ago
|
. /lib/netifd/netifd-proto.sh
|
||
15 years ago
|
|
||
|
find_3g_iface() {
|
||
|
local cfg="$1"
|
||
|
local tty="$2"
|
||
|
|
||
|
local proto
|
||
|
config_get proto "$cfg" proto
|
||
14 years ago
|
[ "$proto" = 3g ] || return 0
|
||
15 years ago
|
|
||
14 years ago
|
local dev
|
||
|
config_get dev "$cfg" device
|
||
15 years ago
|
|
||
14 years ago
|
if [ "${dev##*/}" = "${tty##*/}" ]; then
|
||
|
if [ "$ACTION" = add ]; then
|
||
13 years ago
|
available=1
|
||
14 years ago
|
else
|
||
13 years ago
|
available=0
|
||
15 years ago
|
fi
|
||
13 years ago
|
proto_set_available "$cfg" $available
|
||
14 years ago
|
fi
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
case "$DEVICENAME" in
|
||
|
tty*)
|
||
|
[ -e "/dev/$DEVICENAME" ] || [ "$ACTION" = remove ] || exit 0
|
||
|
config_load network
|
||
|
config_foreach find_3g_iface interface "/dev/$DEVICENAME"
|
||
|
;;
|
||
|
esac
|
||
15 years ago
|
|