catch SIGINT and SIGTERM events

This commit is contained in:
fatalerrors
2021-06-18 11:01:20 +02:00
parent 69035c0c11
commit 076a12b770

View File

@@ -9,6 +9,14 @@ function die()
}
export -f die
function terminate()
{
prnt E "$1 reçu, sortie immédiate."
die 128
}
trap terminate 'Ctrl + C' SIGINT
trap terminate 'SIGTERM' SIGTERM
function error()
{
# Check the call is actually the result of an error
@@ -37,7 +45,6 @@ function error()
# Trigger error function on error
trap error ${LINENO} ERR
# Print a backtrace
function backtrace
{