1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/restic_ynh.git synced 2024-09-03 20:16:22 +02:00

fix: use existing settings when upgrading

This commit is contained in:
Lionel Coupouchetty-Ramouchetty 2020-11-15 11:32:24 +01:00
parent a76bd63d89
commit 4a7c185976
2 changed files with 15 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#!/bin/bash
set -u
invocation_id=$(systemctl show -p InvocationID --value restic.service)
invocation_id=$(systemctl show -p InvocationID --value {{ app }}.service)
hostname=$(hostname)
subject="YunoHost Restic backup log on ${hostname}"
backup_results=$(/bin/journalctl _SYSTEMD_INVOCATION_ID=${invocation_id} | grep -oP '(?<= )[a-zA-Z_-]+: \w+')

View file

@ -13,8 +13,21 @@ source /usr/share/yunohost/helpers
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
export app=$YNH_APP_INSTANCE_NAME
export final_path="/opt/yunohost/${app}"
export server=$(ynh_app_setting_get $app server)
export port=$(ynh_app_setting_get $app port)
export ssh_user=$(ynh_app_setting_get $app ssh_user)
export backup_path=$(ynh_app_setting_get $app backup_path)
export passphrase=$(ynh_app_setting_get $app passphrase)
export on_calendar=$(ynh_app_setting_get $app on_calendar)
export check_on_calendar=$(ynh_app_setting_get $app check_on_calendar)
export check_read_data_on_calendar=$(ynh_app_setting_get $app check_read_data_on_calendar)
export conf=$(ynh_app_setting_get $app conf)
export data=$(ynh_app_setting_get $app data)
export apps=$(ynh_app_setting_get $app apps)
export allow_extra_space_use=$(ynh_app_setting_get $app allow_extra_space_use)
#=================================================
# CHECK IF AN UPGRADE IS NEEDED