bacman: handle SIGHUP, SIGINT, SIGTERM signals
Trap SIGHUP, SIGINT, SIGTERM and remove working directories accordingly. Signed-off-by: Gordian Edenhofer <gordian.edenhofer@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
7568928e71
commit
52ec8dfffe
1 changed files with 10 additions and 0 deletions
|
@ -33,6 +33,16 @@ ARGS=("$@")
|
||||||
|
|
||||||
m4_include(../scripts/library/output_format.sh)
|
m4_include(../scripts/library/output_format.sh)
|
||||||
|
|
||||||
|
# Lazy recursive clean up of temporary dirs
|
||||||
|
work_dir_root="${TMPDIR:-/tmp}/bacman"
|
||||||
|
clean_up() {
|
||||||
|
rm -rf "$work_dir_root".*
|
||||||
|
echo
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
# Trap termination signals
|
||||||
|
trap clean_up SIGHUP SIGINT SIGTERM
|
||||||
|
|
||||||
#
|
#
|
||||||
# User Friendliness
|
# User Friendliness
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue