mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
update-tunnelbroker: add error handling for fetch command
This commit is contained in:
parent
dd22dfd26d
commit
ebaa9b617d
1 changed files with 7 additions and 3 deletions
|
@ -38,9 +38,13 @@
|
||||||
$LogPrintExit2 error $0 ("Downloading required certificate failed.") true;
|
$LogPrintExit2 error $0 ("Downloading required certificate failed.") true;
|
||||||
}
|
}
|
||||||
$LogPrintExit2 info $0 ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress) false;
|
$LogPrintExit2 info $0 ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress) false;
|
||||||
/tool/fetch check-certificate=yes-without-crl \
|
:do {
|
||||||
("https://ipv4.tunnelbroker.net/nic/update\?hostname=" . $Comment->"id") \
|
/tool/fetch check-certificate=yes-without-crl \
|
||||||
user=($Comment->"user") password=($Comment->"pass") output=none as-value;
|
("https://ipv4.tunnelbroker.net/nic/update\?hostname=" . $Comment->"id") \
|
||||||
|
user=($Comment->"user") password=($Comment->"pass") output=none as-value;
|
||||||
|
} on-error={
|
||||||
|
$LogPrintExit2 error $0 ("Failed sending the local address to tunnelbroker! Wrong credentials?") true;
|
||||||
|
}
|
||||||
/interface/6to4/set $Interface local-address=$PublicAddress;
|
/interface/6to4/set $Interface local-address=$PublicAddress;
|
||||||
} else={
|
} else={
|
||||||
$LogPrintExit2 debug $0 ("All tunnelbroker configuration is up to date for interface " . $InterfaceVal->"name" . ".") false;
|
$LogPrintExit2 debug $0 ("All tunnelbroker configuration is up to date for interface " . $InterfaceVal->"name" . ".") false;
|
||||||
|
|
Loading…
Reference in a new issue