replaced iptables with nftables

This commit is contained in:
2026-02-01 16:37:08 +01:00
parent 143d5fd470
commit 8b49189438
2 changed files with 11 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ show_help(){
echo " -y | Answer all questions with yes"
echo ""
echo "-- MODES --"
echo " access | control over remote access to the device (mac-based-filtering using iptables)"
echo " access | control over remote access to the device (mac-based-filtering using nftables)"
exit 0
}

View File

@@ -6,12 +6,12 @@ allow_mac(){
}
check(){
if command -v iptables &>/dev/null
if command -v nftables &>/dev/null
then
echo "iptables is installed. Check passed. Bye."
echo "nftables is installed. Check passed. Bye."
exit 0;
else
echo "Please install iptables."
echo "Please install nftables."
while [[ -z "$HAD_BEST_SUCCESS" ]]; do
read -p "Install now? [y/N] " QUESTION
if [[ -z "$QUESTION" ]] || [[ "$QUESTION" = "n" ]] || [[ "$QUESTION" = "N" ]]; then
@@ -20,27 +20,27 @@ check(){
fi
if [[ "$QUESTION" = "y" ]] || [[ "$QUESTION" = "Y" ]]; then
HAD_BEST_SUCCESS="true"
echo "Trying to install iptables..."
echo "Trying to install nftables..."
if command -v apt &>/dev/null
then
sudo apt update
sudo apt install iptables -y
echo "Attempted to install iptables. Please execute the check again. Bye."
sudo apt install nftables -y
echo "Attempted to install nftables. Please execute the check again. Bye."
exit 0;
fi
if command -v dnf &>/dev/null
then
sudo dnf update
sudo dnf install iptables -y
echo "Attempted to install iptables. Please execute the check again. Bye."
sudo dnf install nftables -y
echo "Attempted to install nftables. Please execute the check again. Bye."
exit 0;
fi
if command -v pacman &>/dev/null
then
sudo pacman -S iptables
echo "Attempted to install iptables. Please execute the check again. Bye."
sudo pacman -S nftables
echo "Attempted to install nftables. Please execute the check again. Bye."
exit 0;
fi
fi