1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/homeassistant_ynh.git synced 2024-09-03 19:26:16 +02:00
This commit is contained in:
ewilly 2021-11-18 21:40:36 +01:00
parent c16ccacc12
commit bcd082450b
4 changed files with 3 additions and 12 deletions

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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..."