Compare commits

..

No commits in common. "1910de65689fe1b6db6ce595f0def7cb3f3bf1ed" and "e81d51399c71c13f4bdcd3329d57fc54d7ec6192" have entirely different histories.

3 changed files with 82 additions and 13 deletions

View File

@ -56,10 +56,6 @@ function default_settings() {
function update_script() {
header_info
if [[ ! -d /opt/AdGuardHome ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
[[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
fi
wget -qL https://static.adguard.com/adguardhome/release/AdGuardHome_linux_amd64.tar.gz
msg_info "Stopping AdguardHome"
systemctl stop AdGuardHome

View File

@ -63,6 +63,7 @@ function update_script() {
"1" "Update Core" ON \
"2" "Install HACS" OFF \
"3" "Install FileBrowser" OFF \
"4" "Install/Update AppDaemon" OFF \
3>&1 1>&2 2>&3)
header_info
if [ "$UPD" == "1" ]; then
@ -77,7 +78,7 @@ function update_script() {
echo -e "${GN}Updating to Stable Version${CL}"
BR=""
fi
if [[ "$PY" == "python3.11" ]]; then echo -e "⚠️ Home Assistant will soon require Python 3.12."; fi
if [[ "$PY" == "python3.10" ]]; then echo -e "⚠️ Home Assistant now requires Python 3.11 to run."; fi
msg_info "Stopping Home Assistant"
systemctl stop homeassistant
@ -135,6 +136,78 @@ WantedBy=default.target" >$service_path
${BL}http://$IP:8080${CL} admin|changeme\n"
exit
fi
if [ "$UPD" == "4" ]; then
clear
header_info
if [[ ! -d /srv/appdaemon ]]; then
msg_info "Installing AppDaemon"
mkdir /srv/appdaemon
cd /srv/appdaemon
python3 -m venv .
source bin/activate
pip install appdaemon &>/dev/null
mkdir -p /root/.homeassistant/appdaemon/apps
cat >/root/.homeassistant/appdaemon/appdaemon.yaml <<EOF
# Sample appdaemon.yml file
# For configuration, please visit: https://appdaemon.readthedocs.io/en/latest/CONFIGURE.html
appdaemon:
time_zone: CET
latitude: 51.725
longitude: 14.3434
elevation: 0
plugins:
HASS:
type: hass
ha_url: <home_assistant_base_url>
token: <some_long_lived_access_token>
http:
url: http://127.0.0.1:5050
admin:
api:
EOF
msg_ok "Installed AppDaemon"
msg_info "Creating Service"
cat >/etc/systemd/system/appdaemon.service <<EOF
[Unit]
Description=AppDaemon
After=homeassistant.service
Requires=homeassistant.service
[Service]
Type=simple
WorkingDirectory=/root/.homeassistant/appdaemon
ExecStart=/srv/appdaemon/bin/appdaemon -c "/root/.homeassistant/appdaemon"
RestartForceExitStatus=100
[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now appdaemon &>/dev/null
msg_ok "Created Service"
msg_ok "Completed Successfully!\n"
echo -e "AppDaemon should be reachable by going to the following URL.
${BL}http://$IP:5050${CL}\n"
exit
else
msg_info "Upgrading AppDaemon"
msg_info "Stopping AppDaemon"
systemctl stop appdaemon
msg_ok "Stopped AppDaemon"
msg_info "Updating AppDaemon"
source /srv/appdaemon/bin/activate
pip install --upgrade appdaemon &>/dev/null
msg_ok "Updated AppDaemon"
msg_info "Starting AppDaemon"
systemctl start appdaemon
sleep 2
msg_ok "Started AppDaemon"
msg_ok "Update Successful"
echo -e "\n Go to http://${IP}:5050 \n"
exit
fi
fi
}
start

View File

@ -20,18 +20,18 @@ $STD apt-get install -y mc
$STD apt-get install -y apt-transport-https
msg_ok "Installed Dependencies"
msg_info "Installing PHP 8.2"
msg_info "Installing PHP 8.1"
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
echo -e "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $VERSION main" >/etc/apt/sources.list.d/php.list
$STD apt-get update
$STD apt-get install -y php8.2
$STD apt-get install -y libapache2-mod-php8.2
$STD apt-get install -y php8.2-sqlite3
$STD apt-get install -y php8.2-gd
$STD apt-get install -y php8.2-intl
$STD apt-get install -y php8.2-mbstring
msg_ok "Installed PHP 8.2"
$STD apt-get install -y php8.1
$STD apt-get install -y libapache2-mod-php8.1
$STD apt-get install -y php8.1-sqlite3
$STD apt-get install -y php8.1-gd
$STD apt-get install -y php8.1-intl
$STD apt-get install -y php8.1-mbstring
msg_ok "Installed PHP 8.1"
msg_info "Installing grocy"
latest=$(curl -s https://api.github.com/repos/grocy/grocy/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')