From a304a2fa69f68aa1c05058edc6d9569b054b5ddc Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 3 Apr 2020 14:29:31 +0200 Subject: update-tunnelbroker: check status of certificate download Also use $LogPrintExit... --- update-tunnelbroker | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'update-tunnelbroker') 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; } } -- cgit v1.2.3-54-g00ecf