We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bad9b84 commit 811524eCopy full SHA for 811524e
etc/scripts/iptsd-foreach
@@ -168,9 +168,23 @@ function run-iptsd-foreach() {
168
tmux -S "${tmux_socket}" new-session -d -n iptsd
169
fi
170
171
+ # Save existing traps
172
+ local -r saved_traps="$(trap)"
173
+
174
+ # Ignore SIGINT and SIGTERM, these have to be handled by xargs / iptsd
175
+ trap -- "" SIGINT
176
+ trap -- "" SIGTERM
177
178
# Run the supplied commands on all devices
179
echo -n "${devices[@]}" | xargs -d ' ' -P "${xargs_procs}" -i "${xargs_cmd[@]}"
180
181
+ # Restore SIGINT and SIGTERM to their defaults
182
+ trap -- - SIGINT
183
+ trap -- - SIGTERM
184
185
+ # Restore previous traps
186
+ eval "${saved_traps}"
187
188
if [ -n "${tmux_socket}" ]; then
189
tmux -S "${tmux_socket}" kill-window -t 0
190
tmux -S "${tmux_socket}" attach
0 commit comments