From ac28d14ed8aa8d9cd3de5de2ed8e28322c791404 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Fri, 3 Feb 2017 07:46:37 -0600 Subject: [PATCH] add trap for SIGTERM and SIGINT --- scripts/snap-pac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/snap-pac b/scripts/snap-pac index 7e6a715..6b5f54a 100755 --- a/scripts/snap-pac +++ b/scripts/snap-pac @@ -22,6 +22,14 @@ set -e +function kill_exit +{ + printf "\nExited due to user intervention.\n" + exit 1 +} + +trap kill_exit SIGTERM SIGINT + SNAPPER_CONFIG_FILE=/etc/conf.d/snapper ERRORMSG=" \033[00;31mERROR:\033[00m"