aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/check5
-rw-r--r--lib/keyringer/completions/bash/keyringer1
-rwxr-xr-xlib/keyringer/functions2
3 files changed, 7 insertions, 1 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/completions/bash/keyringer b/lib/keyringer/completions/bash/keyringer
index 10b852e..4aa4b75 100644
--- a/lib/keyringer/completions/bash/keyringer
+++ b/lib/keyringer/completions/bash/keyringer
@@ -1,4 +1,3 @@
-#!bash
#
# Keyringer bash completion
#
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