mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-21 23:38:49 -05:00
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
@ -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…
Reference in New Issue
Block a user