fix install under docker
This commit is contained in:
@@ -14,13 +14,12 @@ what=$1
|
|||||||
on_ha=0
|
on_ha=0
|
||||||
where=""
|
where=""
|
||||||
venv=""
|
venv=""
|
||||||
prog=$(realpath $0)
|
|
||||||
[ "$2" = "HA" ] && on_ha=1
|
[ "$2" = "HA" ] && on_ha=1
|
||||||
[ -z "$what" ] && what="client"
|
[ -z "$what" ] && what="client"
|
||||||
|
|
||||||
if [ -d /homeassistant ]; then
|
if [ -d /homeassistant ]; then # if running from HA command line
|
||||||
echo "HA, running \"docker exec homeassistant $prog $@\""
|
echo "HA, running \"docker exec homeassistant /config/bin/hb_install.sh $@\""
|
||||||
docker exec homeassistant $prog $@ HA
|
docker exec homeassistant /config/bin/hb_install.sh $@ HA
|
||||||
rc=$?
|
rc=$?
|
||||||
if [ $rc -ne 0 ]; then
|
if [ $rc -ne 0 ]; then
|
||||||
echo "Failed to install heartbeat in HA, please check the logs for more details"
|
echo "Failed to install heartbeat in HA, please check the logs for more details"
|
||||||
@@ -29,7 +28,7 @@ if [ -d /homeassistant ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $on_ha -eq 1 ]; then
|
if [ $on_ha -eq 1 ] || [ -r /.dockerenv ] && [ -d /config/bin ]; then
|
||||||
# Installing under docker on Home Assistant OS, using /config/bin for executables and /config/venvs for virtual environments
|
# Installing under docker on Home Assistant OS, using /config/bin for executables and /config/venvs for virtual environments
|
||||||
echo "Home Assistant OS detected, installing under docker"
|
echo "Home Assistant OS detected, installing under docker"
|
||||||
where="/config/bin"
|
where="/config/bin"
|
||||||
@@ -111,6 +110,6 @@ if [ ! -z "$venv" ]; then
|
|||||||
fi
|
fi
|
||||||
echo "Installation complete. To upgrade, run the following:"
|
echo "Installation complete. To upgrade, run the following:"
|
||||||
echo " $where/hb_install.sh $what"
|
echo " $where/hb_install.sh $what"
|
||||||
echo "To install on another machine, run the following command on that machine:"
|
echo "To install on another machine, run the following obtain the install script and run it:"
|
||||||
echo " curl -s -o $where/hb_install.sh https://git.wrede.ca/andreas/heartbeat/raw/branch/master/scripts/hb_install.sh"
|
echo "from https://git.wrede.ca/andreas/heartbeat/raw/branch/master/scripts/hb_install.sh"
|
||||||
echo " and then run $where/hb_install.sh [mini|client]"
|
echo "and then run sh hb_install.sh [mini|client]"
|
||||||
Reference in New Issue
Block a user