From 627e39d40b7a715163bdbc2f66e844c1c0787501 Mon Sep 17 00:00:00 2001 From: SamNet-dev Date: Wed, 4 Feb 2026 15:55:19 -0600 Subject: [PATCH] fix: auto-install iptables if missing (#14) Debian Trixie and other newer distros use nftables by default and don't have iptables installed. Add iptables to dependency check so it gets installed automatically during setup. Reported-by: @Shaheding --- paqctl.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/paqctl.sh b/paqctl.sh index c408536..d05a188 100644 --- a/paqctl.sh +++ b/paqctl.sh @@ -251,6 +251,19 @@ check_dependencies() { esac fi + # iptables is required for firewall rules (server mode) + if ! command -v iptables &>/dev/null; then + log_info "Installing iptables..." + case "$PKG_MANAGER" in + apt) install_package iptables || log_warn "Could not install iptables - firewall rules may not work" ;; + dnf|yum) install_package iptables || log_warn "Could not install iptables" ;; + pacman) install_package iptables || log_warn "Could not install iptables" ;; + zypper) install_package iptables || log_warn "Could not install iptables" ;; + apk) install_package iptables || log_warn "Could not install iptables" ;; + *) log_warn "Please install iptables manually for firewall rules to work" ;; + esac + fi + # libpcap is required by paqet install_libpcap }