3 if [ "$ACTION" = ifup
]; then
13 config_get proto
"$cfg" proto
14 [ "$proto" = 6in4
] ||
return 0
17 config_get wandev
"$cfg" wan_device
"$(find_6in4_wanif)"
18 [ "$wandev" = "$DEVICE" ] ||
return 0
21 local wanip
=$
(find_6in4_wanip
"$wandev")
22 config_get oldip
"$cfg" ipaddr
24 [ -n "$wanip" ] && [ "$oldip" != "$wanip" ] && {
26 config_get tunnelid
"$cfg" tunnelid
29 config_get username
"$cfg" username
32 config_get password
"$cfg" password
34 [ -n "$tunnelid" ] && [ -n "$username" ] && [ -n "$password" ] && {
35 password
="$(echo -n "$password" | md5sum)"; password
="${password%% *}"
36 uci_set_state network
"$cfg" ipaddr
"$wanip"
38 ( wget
-qO/dev
/null
"http://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&user_id=$username&pass=$password&tunnel_id=$tunnelid" && ifup
"$cfg" )&
43 config_foreach update_tunnel interface