use trap for error

This commit is contained in:
James Barnett 2017-02-03 07:54:24 -06:00
parent c5b822c2dd
commit 8ef411732e
No known key found for this signature in database
GPG key ID: E4B5E45AA3B8C5C3

View file

@ -20,7 +20,10 @@
# Main script. # Main script.
set -e function error_exit
{
exit 1
}
function kill_exit function kill_exit
{ {
@ -28,6 +31,7 @@ function kill_exit
exit 1 exit 1
} }
trap error_exit ERR
trap kill_exit SIGTERM SIGINT trap kill_exit SIGTERM SIGINT
SNAPPER_CONFIG_FILE=/etc/conf.d/snapper SNAPPER_CONFIG_FILE=/etc/conf.d/snapper