use trap for error
This commit is contained in:
parent
c5b822c2dd
commit
8ef411732e
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue