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:
Gmer4Lfe
2026-08-22 00:20:40 -04:00
parent 41c0598220
commit f8119f3786
2 changed files with 67 additions and 1 deletions
+10 -1
View File
@@ -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