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-25 20:31:25 +01:00
parent c2152d0c97
commit 8fb2561dd4
3 changed files with 9 additions and 0 deletions

View file

@ -15,6 +15,8 @@ domain=$(ynh_app_setting_get --app="$app" --key=domain)
# definie useful vars # definie useful vars
final_path="/opt/yunohost/$app" final_path="/opt/yunohost/$app"
data_path="/home/yunohost.app/$app" data_path="/home/yunohost.app/$app"
log_file="/var/log/$app/$app.log"
path_url="/"
# backup source & conf files # backup source & conf files
ynh_print_info --message="Declaring files to be backed up..." ynh_print_info --message="Declaring files to be backed up..."
@ -24,5 +26,6 @@ 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.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="$(dirname "$log_file")"
ynh_print_info --message="Backup of $app completed" ynh_print_info --message="Backup of $app completed"

View file

@ -14,6 +14,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
final_path="/opt/yunohost/$app" final_path="/opt/yunohost/$app"
data_path="/home/yunohost.app/$app" data_path="/home/yunohost.app/$app"
log_file="/var/log/$app/$app.log" log_file="/var/log/$app/$app.log"
path_url="/"
# Remove a service from the admin panel, added by `yunohost service add` # Remove a service from the admin panel, added by `yunohost service add`
if ynh_exec_warn_less yunohost service status "$app" >/dev/null ; then if ynh_exec_warn_less yunohost service status "$app" >/dev/null ; then

View file

@ -50,6 +50,11 @@ ynh_restore_file --origin_path="$data_path"
chown -R $app: "$data_path" chown -R $app: "$data_path"
chmod -R +x "$data_path/.$app/bin" chmod -R +x "$data_path/.$app/bin"
# restore log
ynh_script_progression --message="Restoring the app..."
ynh_restore_file --origin_path="$(dirname "$log_file")"
chown -R $app: "$log_file"
# add required packages # add required packages
ynh_script_progression --message="Restoring the packages dependencies..." ynh_script_progression --message="Restoring the packages dependencies..."
myynh_install_dependencies --python="$python" myynh_install_dependencies --python="$python"