diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2025-01-04 17:27:49 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2025-01-04 17:27:49 -0300 |
commit | f86a76e2cf2b84c63adb258b1aecad10bb11bb49 (patch) | |
tree | 774d0531c67f7e62d121a68b8650432724c2203a /lib | |
parent | 162944bc4919579dfae34a59b9c04a86f3509316 (diff) | |
download | keyringer-f86a76e2cf2b84c63adb258b1aecad10bb11bb49.tar.gz keyringer-f86a76e2cf2b84c63adb258b1aecad10bb11bb49.tar.bz2 |
Fix: check: non-zero exit status when there's a warning
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/keyringer/actions/check | 5 | ||||
-rwxr-xr-x | lib/keyringer/functions | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/keyringer/actions/check b/lib/keyringer/actions/check index 8722381..58adaf5 100755 --- a/lib/keyringer/actions/check +++ b/lib/keyringer/actions/check @@ -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 diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 308d0ea..0a5ad57 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -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 |