From bcd082450b5ed899fefc479c2939f4302baabb86 Mon Sep 17 00:00:00 2001 From: ewilly Date: Thu, 18 Nov 2021 21:40:36 +0100 Subject: [PATCH] Fix --- scripts/backup | 8 -------- scripts/install | 1 - scripts/restore | 2 +- scripts/upgrade | 4 ++-- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/scripts/backup b/scripts/backup index 9d57199..7e052b1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -21,10 +21,6 @@ ynh_print_info --message="Storing the python version in settings..." python=$(cat "$final_path/bin/python3" --version | cut -d ' ' -f 2) ynh_app_setting_set --app="$app" --key=python --value="$python" -# stop systemd service to avoid dump in database -ynh_print_info --message="Stoping service..." -ynh_systemd_action --service_name="$app@$app" --action=stop --line_match="Stopped Home Assistant" --log_path="systemd" --timeout=3600 - # backup source & conf files ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" @@ -34,8 +30,4 @@ ynh_backup --src_path="/etc/sudoers.d/$app" ynh_backup --src_path="/etc/systemd/system/$app@$app.service" ynh_backup --src_path="/etc/logrotate.d/$app" -# restart systemd service -ynh_print_info --message="Restarting the Home Assistant server..." -ynh_systemd_action --service_name="$app@$app" --action=restart - ynh_print_info --message="Backup of $app completed" diff --git a/scripts/install b/scripts/install index 387325f..f11cc04 100644 --- a/scripts/install +++ b/scripts/install @@ -17,7 +17,6 @@ is_public=$YNH_APP_ARG_IS_PUBLIC # definie useful vars final_path="/opt/yunohost/$app" data_path="/home/yunohost.app/$app" -data_path/.$app="$data_path/.$app" path_url="/" # check domain/path availability diff --git a/scripts/restore b/scripts/restore index a3df1fa..8913324 100644 --- a/scripts/restore +++ b/scripts/restore @@ -62,7 +62,7 @@ yunohost service add "$app@$app" --log "$data_path/.$app/home-assistant.log" --d # restart the app ynh_script_progression --message="Starting the Home Assistant server..." sed --in-place "/ExecStart/s/$/ --verbose/" "/etc/systemd/system/$app@$app.service" -ynh_systemd_action --service_name="$app@$app" --action=start --line_match="Home Assistant initialized" --log_path="systemd" --timeout=3600 +ynh_systemd_action --service_name="$app@$app" --action=start --line_match="Home Assistant initialized" --log_path="systemd" --timeout=900 # remove --verbose from service and restart ynh_replace_string --match_string=" --verbose" --replace_string="" --target_file="/etc/systemd/system/$app@$app.service" diff --git a/scripts/upgrade b/scripts/upgrade index a000e17..d0152bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,7 +31,7 @@ fi # move $data_path to new directory ynh_script_progression --message="Moving existing datas to new location..." if [ ! -d "$data_path" ] ; then - mv "/home/$app" "$data_path" + mv "/""home""/$app" "$data_path" ynh_replace_string --match_string="/home/homeassistant/.homeassistant" --replace_string="$data_path/.$app" --target_file="$data_path/.$app/configuration.yaml" chown -R $app: "$data_path" fi @@ -45,7 +45,7 @@ myynh_install_dependencies --python="$PY_REQUIRED_VERSION" # stop systemd service ynh_script_progression --message="Stoping service..." -ynh_systemd_action --service_name="$app@$app" --action=stop --line_match="Stopped Home Assistant" --log_path="systemd" --timeout=3600 +ynh_systemd_action --service_name="$app@$app" --action=stop --line_match="Stopped Home Assistant" --log_path="systemd" --timeout=300 # installation in a virtual environment ynh_script_progression --message="Installing Home Assistant in a virtual environment..."