From ad22aeadfa2ae1fd9112b9cc758860142a869521 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 9 Sep 2019 09:01:04 +0200 Subject: rotate-keys: only complain if EXIT trap is set --- rotate-keys.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'rotate-keys.in') diff --git a/rotate-keys.in b/rotate-keys.in index 8c51e62..970d533 100644 --- a/rotate-keys.in +++ b/rotate-keys.in @@ -76,8 +76,9 @@ if [ "$(whoami)" != "${certificate_user}" ]; then exit 1 fi -if [ -n "$(trap)" ]; then - >&2 echo 'outer traps set - those will be forgotten!' +if trap \ +| grep -q ' EXIT$'; then + >&2 echo 'outer EXIT trap set - this will be forgotten!' exit 1 fi -- cgit v1.2.3-54-g00ecf