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
This commit is contained in:
13
paqctl.sh
13
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user