only kill children, if we got signalled

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-05-10 17:11:15 +02:00
parent a202826a62
commit ee076ef7e9
1 changed files with 8 additions and 2 deletions

View File

@ -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
################################################################################