Fix upgrade and restore

This commit is contained in:
Maniack Crudelis 2018-02-25 15:14:30 +01:00
parent f952320027
commit f45c1b6b2c
4 changed files with 12 additions and 11 deletions

View file

@ -28,7 +28,6 @@
unattended_mail="Only if there was an error" unattended_mail="Only if there was an error"
unattended_verbosity="2" unattended_verbosity="2"
; Checks ; Checks
pkg_linter=1
setup_nourl=1 setup_nourl=1
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1
@ -41,7 +40,6 @@
unattended_mail="Never" unattended_mail="Never"
unattended_verbosity="3" unattended_verbosity="3"
; Checks ; Checks
pkg_linter=1
setup_nourl=1 setup_nourl=1
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1

View file

@ -55,7 +55,6 @@ ynh_install_app_dependencies apticron unattended-upgrades apt-listchanges
#================================================= #=================================================
apticron_config="/etc/apticron/apticron.conf" apticron_config="/etc/apticron/apticron.conf"
ynh_replace_string "# NOTIFY_NO_UPDATES=.*" "&\nNOTIFY_NO_UPDATES=1" "$apticron_config"
ynh_replace_string "# CUSTOM_SUBJECT=.*" \ ynh_replace_string "# CUSTOM_SUBJECT=.*" \
"&\nCUSTOM_SUBJECT=\'[apticron] \$SYSTEM: \$NUM_PACKAGES package update(s)\'" "$apticron_config" "&\nCUSTOM_SUBJECT=\'[apticron] \$SYSTEM: \$NUM_PACKAGES package update(s)\'" "$apticron_config"
ynh_replace_string "# CUSTOM_NO_UPDATES_SUBJECT=.*" \ ynh_replace_string "# CUSTOM_NO_UPDATES_SUBJECT=.*" \

View file

@ -67,12 +67,12 @@ ynh_restore_file "/etc/cron.d/apticron"
# SEND A README FOR THE ADMIN # SEND A README FOR THE ADMIN
#================================================= #=================================================
message="To modify any option of unattended-upgrades, please have a look to $unattended_upgrades_config and message="To modify any option of unattended-upgrades, please have a look to /etc/apt/apt.conf.d/50unattended-upgrades and
/etc/apt/apt.conf.d/02periodic /etc/apt/apt.conf.d/02periodic
Unattended-upgrades will be executed every day at midnight. Unattended-upgrades will be executed every day at midnight.
To modify the configuration of apticron, please have a look to $apticron_config. To modify the configuration of apticron, please have a look to /etc/apticron/apticron.conf.
Apticron will be executed, depending of the requested configuration at 8 p.m. and 2 a.m. If you want to change this schedule, please have a look to the cron file $apticron_cron. Apticron will be executed, depending of the requested configuration at 8 p.m. and 2 a.m. If you want to change this schedule, please have a look to the cron file /etc/cron.d/apticron.
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/unattended_upgrades_ynh" If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/unattended_upgrades_ynh"

View file

@ -16,6 +16,8 @@ source _sed
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
unattended_verbosity=$(ynh_app_setting_get $app unattended_verbosity)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
@ -26,12 +28,14 @@ ynh_abort_if_up_to_date
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
# It's impossible to make a backup here, because the backup name is going to have 32 characters. Which is not allowed...
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade # ynh_backup_before_upgrade
ynh_clean_setup () { # ynh_clean_setup () {
# restore it if the upgrade fails # # restore it if the upgrade fails
ynh_restore_upgradebackup # ynh_restore_upgradebackup
} # }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors