Remove old files.

Remove iptables_redirect.sh if exists to download new one.
pull/18/head
schizza 2024-04-28 17:40:57 +02:00
parent d1b7986550
commit cd60d224f4
1 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ NO_COLOR='\033[0m'
ST_PORT=80 ST_PORT=80
LINK="https://raw.githubusercontent.com/schizza/SWS-12500-custom-component/main/iptables_redirect.sh" LINK="https://raw.githubusercontent.com/schizza/SWS-12500-custom-component/main/iptables_redirect.sh"
FILENAME="iptables_redirect.sh"
P_HA=true P_HA=true
P_ST=true P_ST=true
@ -55,7 +56,7 @@ function validate_num() {
} }
function validate_dest() { function validate_dest() {
echo "Validating host '$1' ... " echo -n "Validating host '$1' ... "
if ping -c 2 $1 >/dev/null 2>&1; then if ping -c 2 $1 >/dev/null 2>&1; then
info "OK" info "OK"
true true
@ -106,6 +107,8 @@ for _PATH in "${HA_PATHS[@]}"; do
fi fi
done done
rm -f "$FILENAME"
[ -z $HA_PATH ] && { error "Home Assistant not found!"; } [ -z $HA_PATH ] && { error "Home Assistant not found!"; }
info "found at $HA_PATH" info "found at $HA_PATH"