diff --git a/bin/cdist-config b/bin/cdist-config index 5bbeed6e..31c7afce 100644 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -355,6 +355,8 @@ __cdist_tmp_removal() rm -rf "${__cdist_tmp_dir}" } +# Does not work in children, will be called again in every script! +# Use only in interactive "front end" scripts __cdist_kill_on_interrupt() { __cdist_tmp_removal @@ -364,9 +366,6 @@ __cdist_kill_on_interrupt() # Remove tempfiles at normal exit trap __cdist_tmp_removal EXIT -# Kill children on interrupt -trap __cdist_kill_on_interrupt INT TERM - ################################################################################ # Type diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 138248d6..bf5614bc 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -25,6 +25,9 @@ [ $# -eq 1 ] || __cdist_usage "" set -eu +# Kill children on interrupt - only in interactive scripts +trap __cdist_kill_on_interrupt INT TERM + __cdist_target_host="$1" # Make target host available for non-core diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index b562d0f8..5ebfa1c2 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -25,6 +25,9 @@ [ $# -ge 1 ] || __cdist_usage "[-p] [target host ]" set -u +# Kill children on interrupt - only in interactive scripts +trap __cdist_kill_on_interrupt INT TERM + filter() { awk -v host=$1 '{ print "[" host "] " $0 }'