2010-05-28 22:03:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$ACTION" = ifup ]; then
|
2012-06-05 16:04:23 +00:00
|
|
|
. /lib/functions.sh
|
2010-05-28 22:03:30 +00:00
|
|
|
|
2012-03-19 21:10:04 +00:00
|
|
|
INCLUDE_ONLY=1
|
|
|
|
. /lib/netifd/proto/6in4.sh
|
|
|
|
|
2010-05-28 22:03:30 +00:00
|
|
|
include /lib/network
|
|
|
|
scan_interfaces
|
|
|
|
|
|
|
|
update_tunnel() {
|
|
|
|
local cfg="$1"
|
|
|
|
|
|
|
|
local proto
|
|
|
|
config_get proto "$cfg" proto
|
|
|
|
[ "$proto" = 6in4 ] || return 0
|
|
|
|
|
|
|
|
local wandev
|
2010-07-09 00:17:31 +00:00
|
|
|
config_get wandev "$cfg" wan_device "$(find_6in4_wanif)"
|
2010-05-28 22:03:30 +00:00
|
|
|
[ "$wandev" = "$DEVICE" ] || return 0
|
|
|
|
|
|
|
|
local wanip=$(find_6in4_wanip "$wandev")
|
|
|
|
|
2012-03-19 21:10:04 +00:00
|
|
|
[ -n "$wanip" ] && ifup "$cfg"
|
2010-05-28 22:03:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
config_foreach update_tunnel interface
|
|
|
|
fi
|