2023-03-23 02:48:20 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-01-01 19:13:05 +02:00
|
|
|
# Copyright (c) 2021-2024 tteck
|
2023-03-23 02:48:20 +02:00
|
|
|
# Author: tteck (tteckster)
|
|
|
|
# License: MIT
|
|
|
|
# https://github.com/tteck/Proxmox/raw/main/LICENSE
|
|
|
|
|
2023-06-16 22:42:46 +02:00
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
2023-03-23 02:48:20 +02:00
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
2024-02-01 00:27:20 +02:00
|
|
|
msg_info "Installing Dependencies (Patience)"
|
2024-05-08 07:22:57 +02:00
|
|
|
$STD apt-get install -y {git,curl,sudo,mc,bluez,libffi-dev,libssl-dev,libjpeg-dev,zlib1g-dev,autoconf,build-essential,libopenjp2-7,libturbojpeg0-dev,ffmpeg,liblapack3,liblapack-dev,dbus-broker,libpcap-dev,libavdevice-dev,libavformat-dev,libavcodec-dev,libavutil-dev,libavfilter-dev,libmariadb-dev-compat,libatlas-base-dev,python3-pip,python3.12-venv}
|
2023-06-20 16:02:58 +02:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
2023-03-23 02:48:20 +02:00
|
|
|
msg_info "Installing Home Assistant-Core"
|
|
|
|
mkdir /srv/homeassistant
|
|
|
|
cd /srv/homeassistant
|
|
|
|
python3 -m venv .
|
|
|
|
source bin/activate
|
2024-05-08 07:18:26 +02:00
|
|
|
$STD pip install webrtcvad
|
2023-03-23 02:48:20 +02:00
|
|
|
$STD python3 -m pip install wheel
|
|
|
|
$STD pip install homeassistant
|
2023-06-18 23:39:04 +02:00
|
|
|
$STD pip install mysqlclient
|
|
|
|
$STD pip install psycopg2-binary
|
2023-03-23 02:48:20 +02:00
|
|
|
mkdir -p /root/.homeassistant
|
|
|
|
msg_ok "Installed Home Assistant-Core"
|
|
|
|
|
|
|
|
msg_info "Creating Service"
|
|
|
|
cat <<EOF >/etc/systemd/system/homeassistant.service
|
|
|
|
[Unit]
|
|
|
|
Description=Home Assistant
|
|
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
WorkingDirectory=/root/.homeassistant
|
|
|
|
ExecStart=/srv/homeassistant/bin/hass -c "/root/.homeassistant"
|
2023-05-13 16:02:02 +02:00
|
|
|
Restart=always
|
2023-03-23 02:48:20 +02:00
|
|
|
RestartForceExitStatus=100
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
EOF
|
2024-05-08 07:22:57 +02:00
|
|
|
systemctl enable -q --now homeassistant
|
2023-03-23 02:48:20 +02:00
|
|
|
msg_ok "Created Service"
|
|
|
|
|
|
|
|
motd_ssh
|
2023-05-15 13:39:30 +02:00
|
|
|
customize
|
2023-03-23 02:48:20 +02:00
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2024-05-02 19:26:16 +02:00
|
|
|
$STD apt-get -y autoremove
|
|
|
|
$STD apt-get -y autoclean
|
2023-03-23 02:48:20 +02:00
|
|
|
msg_ok "Cleaned"
|