Move files over to hassbian-scripts package
This commit is contained in:
parent
a8c495da88
commit
42fdbecb52
|
@ -6,13 +6,10 @@ useradd -u 1001 -g 1001 -rm homeassistant
|
|||
EOF
|
||||
|
||||
install -v -o 1001 -g 1001 -d ${ROOTFS_DIR}/srv/homeassistant
|
||||
install -m 644 files/home-assistant@homeassistant.service ${ROOTFS_DIR}/etc/systemd/system/
|
||||
install -m 644 files/install_homeassistant.service ${ROOTFS_DIR}/etc/systemd/system/
|
||||
wget -O files//install_homeassistant.sh https://raw.githubusercontent.com/home-assistant/hassbian-scripts/master/install_homeassistant.sh
|
||||
install -m 755 files/install_homeassistant.sh ${ROOTFS_DIR}/usr/local/bin/
|
||||
wget -O files/hassbian-scripts-0.2.deb https://github.com/home-assistant/hassbian-scripts/releases/download/v0.2/hassbian-scripts-0.2.deb
|
||||
|
||||
on_chroot << EOF
|
||||
systemctl enable install_homeassistant.service
|
||||
dpkg -i files/hassbian-scripts-0.2.deb
|
||||
EOF
|
||||
|
||||
on_chroot << \EOF
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
# This is a simple service file for systems with systemd to tun HA as user.
|
||||
#
|
||||
# For details please check https://home-assistant.io/getting-started/autostart/
|
||||
#
|
||||
[Unit]
|
||||
Description=Home Assistant for %i
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=%i
|
||||
ExecStart=/srv/homeassistant/bin/hass
|
||||
SendSIGKILL=no
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# This is a simple service file for systems with systemd to tun HA as user.
|
||||
#
|
||||
# For details please check https://home-assistant.io/getting-started/autostart/
|
||||
#
|
||||
[Unit]
|
||||
Description=Install Home Assistant
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/install_homeassistant.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "Home Assistant install script for Hassbian"
|
||||
echo "Copyright(c) 2017 Fredrik Lindqvist <https://github.im/Landrash>"
|
||||
|
||||
echo "Changing to homeassistant user"
|
||||
sudo -u homeassistant -H /bin/bash << EOF
|
||||
|
||||
echo "Creating Home Assistant venv"
|
||||
python3 -m venv /srv/homeassistant
|
||||
|
||||
echo "Changing to Home Assistant venv"
|
||||
source /srv/homeassistant/bin/activate
|
||||
|
||||
echo "Install latest version of Home Assistant"
|
||||
pip3 install homeassistant
|
||||
|
||||
echo "Deactivating virtualenv"
|
||||
deactivate
|
||||
|
||||
echo "Downloading HASSbian helper scripts"
|
||||
cd /home/pi
|
||||
git clone https://github.com/home-assistant/hassbian-scripts.git
|
||||
|
||||
EOF
|
||||
|
||||
echo "Enable Home Assistant service"
|
||||
systemctl enable home-assistant@homeassistant.service
|
||||
sync
|
||||
|
||||
echo "Disable and remove Home Assitant install"
|
||||
systemctl disable install_homeassistant
|
||||
rm /etc/systemd/system/install_homeassistant.service
|
||||
rm /usr/local/bin/install_homeassistant.sh
|
||||
systemctl daemon-reload
|
||||
|
||||
echo "Start Home Assistant"
|
||||
systemctl start home-assistant@homeassistant.service
|
||||
|
||||
echo "Installation done. To continue have a look at "
|
||||
echo "If this script failed then this Raspberry Pi most likely did not have a fully functioning internet connection."
|
Loading…
Reference in New Issue
Block a user