1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

update-tunnelbroker: check status of certificate download

Also use $LogPrintExit...
This commit is contained in:
Christian Hesse
2020-04-03 14:29:31 +02:00
parent dfeaa1ed41
commit a304a2fa69

View File

@ -27,13 +27,15 @@
:if ($PublicAddress != $InterfaceVal->"local-address") do={
:local Comment [ $ParseKeyValueStore ($InterfaceVal->"comment") ];
$CertificateAvailable "Starfield Secure Certificate Authority - G2";
:log info ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress);
:if ([ $CertificateAvailable "Starfield Secure Certificate Authority - G2" ] = false) do={
$LogPrintExit error ("Downloading required certificate failed.") true;
}
$LogPrintExit info ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress) false;
/ tool fetch check-certificate=yes-without-crl \
("https://ipv4.tunnelbroker.net/nic/update\?hostname=" . $Comment->"id") \
user=($Comment->"user") password=($Comment->"pass") output=none;
/ interface 6to4 set $Interface local-address=$PublicAddress;
} else={
:log debug ("All tunnelbroker configuration is up to date for interface " . $InterfaceVal->"name" . ".");
$LogPrintExit debug ("All tunnelbroker configuration is up to date for interface " . $InterfaceVal->"name" . ".") false;
}
}