catch SIGINT and SIGTERM events
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user