mirror of
https://github.com/YunoHost-Apps/unattended_upgrades_ynh.git
synced 2024-10-01 13:35:00 +02:00
76 lines
2.2 KiB
Bash
76 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
source _sed
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
#=================================================
|
|
# CHECK VERSION
|
|
#=================================================
|
|
|
|
ynh_abort_if_up_to_date
|
|
|
|
#=================================================
|
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
|
#=================================================
|
|
|
|
# Backup the current version of the app
|
|
ynh_backup_before_upgrade
|
|
ynh_clean_setup () {
|
|
# restore it if the upgrade fails
|
|
ynh_restore_upgradebackup
|
|
}
|
|
# Exit if an error occurs during the execution of the script
|
|
ynh_abort_if_errors
|
|
|
|
#=================================================
|
|
# STANDARD UPGRADE STEPS
|
|
#=================================================
|
|
# INSTALL DEPENDENCIES
|
|
#=================================================
|
|
|
|
ynh_install_app_dependencies apticron unattended-upgrades apt-listchanges
|
|
|
|
#=================================================
|
|
# SPECIFIC UPGRADE
|
|
#=================================================
|
|
# UPGRADE APTICRON
|
|
#=================================================
|
|
|
|
# Nothing to do here...
|
|
|
|
#=================================================
|
|
# UPGRADE UNATTENDED-UPGRADES
|
|
#=================================================
|
|
|
|
# Nothing to do here...
|
|
|
|
#=================================================
|
|
# UPGRADE APT PERIODIC FOR UNATTENDED
|
|
#=================================================
|
|
|
|
ynh_backup_if_checksum_is_different "/etc/apt/apt.conf.d/02periodic"
|
|
|
|
cp "../conf/02periodic" "/etc/apt/apt.conf.d/02periodic"
|
|
ynh_replace_string "__VERBOSITY__" "$unattended_verbosity" "/etc/apt/apt.conf.d/02periodic"
|
|
# This config file is used by /etc/cron.daily/apt
|
|
|
|
ynh_store_file_checksum "/etc/apt/apt.conf.d/02periodic"
|
|
|
|
#=================================================
|
|
# UPGRADE APTICRON CRON FILE
|
|
#=================================================
|
|
|
|
# Nothing to do here...
|