From 4c8dde1054069a66c22662a17cd77bb65562d290 Mon Sep 17 00:00:00 2001 From: shum Date: Thu, 22 Oct 2026 05:03:54 +0000 Subject: [PATCH] scripts: add a remove mode to the egress rule --- scripts/store-service/egress.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/store-service/egress.sh b/scripts/store-service/egress.sh index 6f56445efd..f6737500fa 100755 --- a/scripts/store-service/egress.sh +++ b/scripts/store-service/egress.sh @@ -22,7 +22,7 @@ V4_EMBEDDING_PREFIXES=(:: ::ffff: 64:ff9b::) usage() { cat </dev/null; do + "$tool" -w -D "$parent" "${args[@]}" -j "$CHAIN" + done + done < <(jumps_for "$tool") + if "$tool" -w -S "$CHAIN" >/dev/null 2>&1; then + "$tool" -w -F "$CHAIN" + "$tool" -w -X "$CHAIN" + fi +} + case $mode in install | dry-run) if [[ ! $bridge ]]; then refuse_login_user; fi collect_allowed ;; check) collect_allowed ;; + remove) ;; *) die "unknown mode $mode" ;; esac @@ -326,6 +344,7 @@ for family in 4 6; do [[ $mode == dry-run ]] || command -v "$tool" >/dev/null || die "$tool is not installed" case $mode in check) check_family "$tool" "$family" || status=1 ;; + remove) remove_family "$tool" ;; *) install_family "$tool" "$family" ;; esac done