2010-05-29 01:03:30 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$ACTION" = ifup ]; then
|
2012-06-05 19:04:23 +03:00
|
|
|
. /lib/functions.sh
|
2010-05-29 01:03:30 +03:00
|
|
|
|
2012-03-19 23:10:04 +02:00
|
|
|
INCLUDE_ONLY=1
|
|
|
|
. /lib/netifd/proto/6in4.sh
|
|
|
|
|
2010-05-29 01:03:30 +03: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 03:17:31 +03:00
|
|
|
config_get wandev "$cfg" wan_device "$(find_6in4_wanif)"
|
2010-05-29 01:03:30 +03:00
|
|
|
[ "$wandev" = "$DEVICE" ] || return 0
|
|
|
|
|
|
|
|
local wanip=$(find_6in4_wanip "$wandev")
|
|
|
|
|
2012-03-19 23:10:04 +02:00
|
|
|
[ -n "$wanip" ] && ifup "$cfg"
|
2010-05-29 01:03:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
config_foreach update_tunnel interface
|
|
|
|
fi
|