Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Merge pull request #223 from home-assistant/dev
Browse files Browse the repository at this point in the history
Release 0.11.1
  • Loading branch information
Landrash committed Nov 14, 2018
2 parents c99814c + 0134c1d commit 7ab28de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: hassbian-scripts
Version: 0.11.0
Version: 0.11.1
Priority: optional
Architecture: all
Depends: bash, wget, git, python3, python3-venv, python3-pip, python3-dev, bluetooth, libbluetooth-dev, avahi-daemon, build-essential, libssl-dev, libffi-dev, python-dev,libudev-dev, zip, nodejs, apt-transport-https, bluez-hcidump, bc, figlet
Expand Down
24 changes: 15 additions & 9 deletions package/opt/hassbian/suites/homeassistant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function homeassistant-show-copyright-info {
}

function homeassistant-install-package {
echo "Setting correct premissions"
chown homeassistant:homeassistant -R /srv/homeassistant

echo "Changing to the homeassistant user"
sudo -u homeassistant -H /bin/bash << EOF
Expand All @@ -22,8 +25,8 @@ echo "Changing to Home Assistant venv"
source /srv/homeassistant/bin/activate
echo "Installing latest version of Home Assistant"
pip3 install setuptools wheel
pip3 install homeassistant
python3 -m pip install setuptools wheel
python3 -m pip install homeassistant
echo "Deactivating virtualenv"
deactivate
Expand Down Expand Up @@ -91,7 +94,7 @@ else
fi
sudo -u homeassistant -H /bin/bash << EOF | grep Version | awk '{print $2}'|while read -r version; do if [[ "${newversion}" == "${version}" ]]; then echo "You already have version: $version";exit 1;fi;done
source /srv/homeassistant/bin/activate
pip3 show homeassistant
python3 -m pip show homeassistant
EOF

if [[ $? == 1 ]]; then
Expand All @@ -100,20 +103,23 @@ EOF
fi
fi

echo "Setting correct premissions"
chown homeassistant:homeassistant -R /srv/homeassistant

echo "Changing to the homeassistant user"
sudo -u homeassistant -H /bin/bash << EOF
echo "Changing to Home Assistant venv"
source /srv/homeassistant/bin/activate
echo "Upgrading Home Assistant"
pip3 install --upgrade setuptools wheel
python3 -m pip install --upgrade setuptools wheel
if [ "$DEV" == "true" ]; then
pip3 install git+https://github.com/home-assistant/home-assistant@dev
python3 -m pip install git+https://github.com/home-assistant/home-assistant@dev
elif [ "$BETA" == "true" ]; then
pip3 install --upgrade --pre homeassistant
python3 -m pip install --upgrade --pre homeassistant
else
pip3 install --upgrade homeassistant=="$newversion"
python3 -m pip install --upgrade homeassistant=="$newversion"
fi
echo "Deactivating virtualenv"
Expand All @@ -128,7 +134,7 @@ if [ "$FORCE" != "true" ]; then
EOF
)
config_check_lines=$(echo "$config_check" | wc -l)
if (( config_check_lines > 1 ));then
if (( config_check_lines > 2 ));then
if [ "$ACCEPT" != "true" ]; then
echo -n "Config check failed for new version, do you want to revert? [Y/n] : "
read -r RESPONSE
Expand All @@ -141,7 +147,7 @@ EOF
if [ "$RESPONSE" == "y" ] || [ "$RESPONSE" == "Y" ]; then
sudo -u homeassistant -H /bin/bash << EOF
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant=="$current_version"
python3 -m pip install --upgrade homeassistant=="$current_version"
deactivate
EOF
fi
Expand Down

0 comments on commit 7ab28de

Please sign in to comment.