2010-05-28 22:03:30 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$ACTION" = ifup ]; then
|
|
|
|
. /etc/functions.sh
|
|
|
|
|
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
|