|
|
@ -673,20 +673,3 @@ function flatten_array { |
|
|
|
IFS=" " read -r -a array <<<"$(tr ' ' '\n' <<<"${array[@]}" | sort -u | tr '\n' ' ')" |
|
|
|
printf '%s\n' "${array[@]}" |
|
|
|
} |
|
|
|
|
|
|
|
function prepare_nftables() { |
|
|
|
local PREFIX="miaou:firewall" |
|
|
|
|
|
|
|
if [[ ! -f /etc/nftables.rules.d/firewall.table ]]; then |
|
|
|
echo "installing nftables ..." |
|
|
|
sudo apt install -y nftables |
|
|
|
sudo cp -f "$MIAOU_BASEDIR/templates/hardened/nftables.conf" /etc/ |
|
|
|
sudo mkdir -p /etc/nftables.rules.d |
|
|
|
sudo cp -f "$MIAOU_BASEDIR/templates/hardened/firewall.table" /etc/nftables.rules.d/ |
|
|
|
sudo systemctl restart nftables |
|
|
|
sudo systemctl enable nftables |
|
|
|
echo "OK" |
|
|
|
else |
|
|
|
echo "nftables already installed!" |
|
|
|
fi |
|
|
|
} |