From d0a0af17c8c5fb25da4ac4a5539a9eb8cee9e55f Mon Sep 17 00:00:00 2001 From: schizza Date: Sun, 28 Apr 2024 17:40:57 +0200 Subject: [PATCH] Remove old files. Remove iptables_redirect.sh if exists to download new one. --- install_iptables.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install_iptables.sh b/install_iptables.sh index 0f8f0a3..2ba5acd 100644 --- a/install_iptables.sh +++ b/install_iptables.sh @@ -10,6 +10,7 @@ NO_COLOR='\033[0m' ST_PORT=80 LINK="https://raw.githubusercontent.com/schizza/SWS-12500-custom-component/main/iptables_redirect.sh" +FILENAME="iptables_redirect.sh" P_HA=true P_ST=true @@ -55,7 +56,7 @@ function validate_num() { } function validate_dest() { - echo "Validating host '$1' ... " + echo -n "Validating host '$1' ... " if ping -c 2 $1 >/dev/null 2>&1; then info "OK" true @@ -106,6 +107,8 @@ for _PATH in "${HA_PATHS[@]}"; do fi done +rm -f "$FILENAME" + [ -z $HA_PATH ] && { error "Home Assistant not found!"; } info "found at $HA_PATH"