From 6e3c8fad3d71fed6aa6415c3753bc151c1250eee Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 28 Feb 2024 15:15:28 +0400 Subject: [PATCH] remove duplicated code --- lib/functions.sh | 17 ----------------- lib/install.sh | 3 ++- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/lib/functions.sh b/lib/functions.sh index cf876a5..23e885d 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -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 -} diff --git a/lib/install.sh b/lib/install.sh index 93c2dc4..d89e206 100755 --- a/lib/install.sh +++ b/lib/install.sh @@ -143,7 +143,8 @@ EOF if [[ -z "$env_container_hostname" ]]; then env_container_hostname=$(hostname -s) if env | grep -q container_hostname; then - local previous_container_hostname=$(env | grep container_hostname | cut -d '=' -f2) + local previous_container_hostname + previous_container_hostname=$(env | grep container_hostname | cut -d '=' -f2) env_container_hostname="$previous_container_hostname $env_container_hostname" fi