2005-11-19 05:17:20 +02:00
|
|
|
#!/bin/sh
|
2006-06-27 03:36:13 +03:00
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
|
2005-07-15 19:56:23 +03:00
|
|
|
[ $# = 0 ] && { echo " $0 <group>"; exit; }
|
2005-02-06 02:58:10 +02:00
|
|
|
. /etc/functions.sh
|
2006-04-05 05:09:22 +03:00
|
|
|
. /etc/config/network
|
2005-07-21 17:02:53 +03:00
|
|
|
|
2005-11-19 05:17:20 +02:00
|
|
|
ifdown $1
|
|
|
|
|
2005-05-31 02:46:18 +03:00
|
|
|
debug "### ifup $type ###"
|
2005-11-19 05:17:20 +02:00
|
|
|
type=$1
|
2005-05-31 02:46:18 +03:00
|
|
|
|
2006-04-05 05:09:22 +03:00
|
|
|
eval "if_proto=\"\${${type}_proto}\""
|
|
|
|
eval "if=\"\${${type}_ifname}\""
|
|
|
|
[ "${if%%[0-9]}" = "ppp" ] && eval "if=\"\${${type}_device}\""
|
2005-10-22 23:47:19 +03:00
|
|
|
|
2005-11-19 05:17:20 +02:00
|
|
|
case "$if_proto" in
|
|
|
|
pppoa) hotplug_dev register atm0; exit 0 ;;
|
2005-11-19 16:53:21 +02:00
|
|
|
pppoe)
|
2006-04-05 05:09:22 +03:00
|
|
|
# PPPoE over ATM
|
|
|
|
[ "$if" = "nas0" ] && {
|
|
|
|
ifconfig nas0 2>&- >&- || {
|
|
|
|
hotplug_dev register atm0
|
|
|
|
exit 0
|
|
|
|
}
|
2005-11-19 05:17:20 +02:00
|
|
|
}
|
|
|
|
;;
|
2005-11-19 16:53:21 +02:00
|
|
|
none|"") exit 0;;
|
2005-11-19 05:17:20 +02:00
|
|
|
esac
|
2005-10-22 23:47:19 +03:00
|
|
|
|
|
|
|
if [ "${if%%[0-9]}" = "br" ]; then
|
2006-04-05 05:09:22 +03:00
|
|
|
eval "ifnames=\"\${${type}_ifnames}\""
|
|
|
|
for sif in $ifnames; do
|
2005-11-19 05:17:20 +02:00
|
|
|
hotplug_dev register "$sif"
|
2005-10-22 23:47:19 +03:00
|
|
|
done
|
|
|
|
else
|
2005-11-19 05:17:20 +02:00
|
|
|
hotplug_dev register "$if"
|
2005-10-22 23:47:19 +03:00
|
|
|
fi
|