bash-5.1# sh /config/replace_hacs_download_mirror.sh
: not foundlace_hacs_download_mirror.sh: line 5:
: not foundlace_hacs_download_mirror.sh: line 10:
: not foundlace_hacs_download_mirror.sh: line 11:
/config/replace_hacs_download_mirror.sh: line 53: syntax error: unexpected end of file (expecting "then")
bash-5.1# /bin/bash -lc 'sh /config/replace_hacs_download_mirror.sh'
: not foundlace_hacs_download_mirror.sh: line 5:
: not foundlace_hacs_download_mirror.sh: line 10:
: not foundlace_hacs_download_mirror.sh: line 11:
/config/replace_hacs_download_mirror.sh: line 53: syntax error: unexpected end of file (expecting "then")
bash-5.1#
if [ ! -d "${ha_path}" ]; then
echo "The homeassistant path '${ha_path}' does not exist. Please double check. You need to run the script in docker.
Run the command 'docker exec -it homeassistant /bin/bash' to enter the HA container in docker."
exit
fi
if [ ! -n "$(curl -m 10 -IL ${github_com_mirror} 2>/dev/null | grep -oP 'HTTP.*200')" ]; then
echo "'${github_com_mirror}' is unable to access, so we sitll use 'github.com'."
github_com_mirror="github.com"
else
echo "'github.com' was replaced to '${github_com_mirror}'".
fi
if [ ! -n "$(curl -m 10 -IL ${raw_githubusercontent_com_mirror}\/hacs\/integration\/main\/LICENSE 2>/dev/null | grep -oP 'HTTP.*200')" ]; then
echo "'${raw_githubusercontent_com_mirror}' is unable to access, so we sitll use 'raw.githubusercontent.com'"
raw_githubusercontent_com_mirror="raw.githubusercontent.com"
else
echo "'raw.githubusercontent.com' was replaced to '${raw_githubusercontent_com_mirror}'."
fi