diff options
-rw-r--r-- | update-tunnelbroker | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/update-tunnelbroker b/update-tunnelbroker index 1b5bb9e..2f7d579 100644 --- a/update-tunnelbroker +++ b/update-tunnelbroker @@ -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; } } |