b5c9b180dc
- Rewrite wg-policy-lib.sh: replace ipset functions with nft helpers, add backup_nftables() - Rewrite wg-policy-engine.sh: generate nft ruleset file, atomic load via nft -f, rollback support - Simplify wg-policy-cleanup.sh: single nft delete table inet wg_policy - Update wg-policy-ctl: nft commands for rules/ipset/stats/backup - Rebuild install.sh: nftables dependency, WireGuard pre-check, PostUp/PostDown auto-integration - Update build.sh/build.bat: match install.sh changes - Update README.md: nftables prerequisites and references
21 lines
440 B
Bash
21 lines
440 B
Bash
#!/bin/bash
|
|
# wg-policy-cleanup.sh — Clean removal of all policy artifacts
|
|
|
|
set -uo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/wg-policy-lib.sh"
|
|
|
|
main() {
|
|
log_info "Starting cleanup..."
|
|
|
|
nft delete table inet wg_policy 2>/dev/null || true
|
|
log_info "Removed nftables table inet wg_policy"
|
|
|
|
rm -f "$LOCK_FILE" 2>/dev/null || true
|
|
|
|
log_info "Cleanup complete"
|
|
}
|
|
|
|
main "$@"
|