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