From ee076ef7e94b4ab3f268bf580432da86a4c123b6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 10 May 2011 17:11:15 +0200 Subject: [PATCH] only kill children, if we got signalled Signed-off-by: Nico Schottelius --- bin/cdist-config | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 56a06025..b1abda29 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -348,15 +348,21 @@ __cdist_remote_type_explorer_dir() ################################################################################ -# Temp clenup +# Traps # __cdist_tmp_removal() { - kill 0 rm -rf "${__cdist_tmp_dir}" } +__cdist_exit_on_kill() +{ + kill 0 + __cdist_tmp_removal +} + trap __cdist_tmp_removal EXIT +trap __cdist_exit_on_kill SIGINT SIGTERM ################################################################################