mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
commit
bfd5c285db
4 changed files with 9 additions and 9 deletions
|
@ -17,7 +17,7 @@
|
||||||
multi_instance=0
|
multi_instance=0
|
||||||
port_already_use=1
|
port_already_use=1
|
||||||
change_url=1
|
change_url=1
|
||||||
actions=1
|
actions=0
|
||||||
config_panel=0
|
config_panel=0
|
||||||
;;; Options
|
;;; Options
|
||||||
Notification=all
|
Notification=all
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
# Release to install
|
# Release to install
|
||||||
VERSION=0.117.6
|
VERSION=2021.1.4
|
||||||
|
|
||||||
# Package dependencies
|
# Package dependencies
|
||||||
PKG_DEPENDENCIES="python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5"
|
PKG_DEPENDENCIES="python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5"
|
||||||
|
|
||||||
# Requirements (Major.Minor.Patch)
|
# Requirements (Major.Minor.Patch)
|
||||||
# PY_VERSION=$(curl -s "https://www.python.org/ftp/python/" | grep ">3.8" | tail -n1 | cut -d '/' -f 2 | cut -d '>' -f 2)
|
# PY_VERSION=$(curl -s "https://www.python.org/ftp/python/" | grep ">3.8" | tail -n1 | cut -d '/' -f 2 | cut -d '>' -f 2)
|
||||||
PY_REQUIRED_VERSION=3.8.6
|
PY_REQUIRED_VERSION=3.8.7
|
||||||
|
|
||||||
# Execute a command as another user
|
# Execute a command as another user
|
||||||
# usage: exec_as USER COMMAND [ARG ...]
|
# usage: exec_as USER COMMAND [ARG ...]
|
||||||
|
@ -108,8 +108,8 @@ myynh_install_dependencies () {
|
||||||
# Install
|
# Install
|
||||||
cd "Python-$python"
|
cd "Python-$python"
|
||||||
./configure --enable-optimizations
|
./configure --enable-optimizations
|
||||||
make -j4
|
ynh_exec_warn_less make -j4
|
||||||
make altinstall
|
ynh_exec_warn_less make altinstall
|
||||||
# Clean
|
# Clean
|
||||||
cd ..
|
cd ..
|
||||||
ynh_secure_remove "Python-$python"
|
ynh_secure_remove "Python-$python"
|
||||||
|
|
|
@ -16,17 +16,17 @@ domain=$(ynh_app_setting_get --app="$app" --key=domain)
|
||||||
final_path="/opt/yunohost/$app"
|
final_path="/opt/yunohost/$app"
|
||||||
home_path="/home/$app"
|
home_path="/home/$app"
|
||||||
|
|
||||||
ynh_script_progression --message="Storing the python version in settings..."
|
ynh_print_info --message="Storing the python version in settings..."
|
||||||
# store python version
|
# store python version
|
||||||
python=$(cat "$final_path/bin/python3" --version | cut -d ' ' -f 2)
|
python=$(cat "$final_path/bin/python3" --version | cut -d ' ' -f 2)
|
||||||
ynh_app_setting_set --app="$app" --key=python --value="$python"
|
ynh_app_setting_set --app="$app" --key=python --value="$python"
|
||||||
|
|
||||||
# backup source & conf files
|
# backup source & conf files
|
||||||
ynh_script_progression --message="Backuping the app, datas & ystem files..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
ynh_backup --src_path="$home_path"
|
ynh_backup --src_path="$home_path"
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_backup --src_path="/etc/sudoers.d/$app"
|
ynh_backup --src_path="/etc/sudoers.d/$app"
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app@$app.service"
|
ynh_backup --src_path="/etc/systemd/system/$app@$app.service"
|
||||||
|
|
||||||
ynh_script_progression --message="Backup of $app completed" --last
|
ynh_print_info --message="Backup of $app completed"
|
||||||
|
|
|
@ -66,7 +66,7 @@ ynh_systemd_action --service_name="$app@$app" --action=start --line_match="Home
|
||||||
# remove --verbose from service and restart
|
# remove --verbose from service and restart
|
||||||
ynh_replace_string --match_string=" --verbose" --replace_string="" --target_file="/etc/systemd/system/$app@$app.service"
|
ynh_replace_string --match_string=" --verbose" --replace_string="" --target_file="/etc/systemd/system/$app@$app.service"
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
ynh_systemd_action --service_name="$app@$app" --action=restart
|
ynh_systemd_action --service_name="$app@$app" --action=restart --line_match="Started Home Assistant" --log_path="systemd" --timeout=3600
|
||||||
|
|
||||||
ynh_script_progression --message="Restoring nginx web server..."
|
ynh_script_progression --message="Restoring nginx web server..."
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
Loading…
Reference in a new issue