]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Fix: check: non-zero exit status when there's a warning
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 4 Jan 2025 20:27:49 +0000 (17:27 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 4 Jan 2025 20:27:49 +0000 (17:27 -0300)
lib/keyringer/actions/check
lib/keyringer/functions

index 872238177c87366d7fb43a1bab80c6317162c434..58adaf50b88c4e4cc4a290d1cb3b1c752b644798 100755 (executable)
@@ -27,3 +27,8 @@ source "$LIB" maintenance $* || exit 1
 
 # This should be done here:
 # TODO: Check canaries' timestamps, warning by mail if configured by user preferences.
+
+# Since this is the check action, it should exit whenever there's a warning
+if [ "$KEYRINGER_HAS_EXPIRING_KEYS" == "1" ]; then
+  exit 1
+fi
index 308d0ea010608981b092dcc007e7a0d26ad1229f..0a5ad570584ce1c6573f2fc32be643df69fd5865 100755 (executable)
@@ -766,6 +766,8 @@ function keyringer_check_expiration {
 
       if [[ "$ahead" -gt "$expiry" ]] && [ "$BASENAME" == "check" ]; then
         echo "Warning: subkey from $recipient will expire soon, on `date --date="@$expiry"`"
+
+        KEYRINGER_HAS_EXPIRING_KEYS="1"
       fi
     fi
   done