Give the test harness a stop that cannot strand its iptables rule, and clean up the dry-run state copy
This commit is contained in:
+10
-1
@@ -928,7 +928,16 @@ echo " $ICON_NET Remote IP: $REMOTE_SERVER"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
FALLBACK_RUNNING=true
|
||||
trap 'FALLBACK_RUNNING=false; warn "Fallback received shutdown signal — stopping cleanly"; exit 0' \
|
||||
|
||||
# The dry-run state copy is per-PID and would otherwise accumulate one file per preview run.
|
||||
# EXIT as well as the signals, because a dry run is usually ended with Ctrl-C or --stop but can
|
||||
# also just fall out of the loop.
|
||||
dryrun_state_cleanup() {
|
||||
[[ "$DRY_RUN" == true && "$FALLBACK_STATE_FILE" == *".dryrun."* ]] && rm -f "$FALLBACK_STATE_FILE"
|
||||
return 0
|
||||
}
|
||||
trap 'dryrun_state_cleanup' EXIT
|
||||
trap 'FALLBACK_RUNNING=false; warn "Fallback received shutdown signal — stopping cleanly"; dryrun_state_cleanup; exit 0' \
|
||||
SIGTERM SIGINT
|
||||
|
||||
while [[ "$FALLBACK_RUNNING" == true ]]; do
|
||||
|
||||
Reference in New Issue
Block a user