Skip to content

Commit ebaa9b6

Browse files
committed
update-tunnelbroker: add error handling for fetch command
1 parent dd22dfd commit ebaa9b6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

update-tunnelbroker

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@
3838
$LogPrintExit2 error $0 ("Downloading required certificate failed.") true;
3939
}
4040
$LogPrintExit2 info $0 ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress) false;
41-
/tool/fetch check-certificate=yes-without-crl \
42-
("https://ipv4.tunnelbroker.net/nic/update\?hostname=" . $Comment->"id") \
43-
user=($Comment->"user") password=($Comment->"pass") output=none as-value;
41+
:do {
42+
/tool/fetch check-certificate=yes-without-crl \
43+
("https://ipv4.tunnelbroker.net/nic/update\?hostname=" . $Comment->"id") \
44+
user=($Comment->"user") password=($Comment->"pass") output=none as-value;
45+
} on-error={
46+
$LogPrintExit2 error $0 ("Failed sending the local address to tunnelbroker! Wrong credentials?") true;
47+
}
4448
/interface/6to4/set $Interface local-address=$PublicAddress;
4549
} else={
4650
$LogPrintExit2 debug $0 ("All tunnelbroker configuration is up to date for interface " . $InterfaceVal->"name" . ".") false;

0 commit comments

Comments
 (0)