#!/bin/bash #================================================= # GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= # Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= app=$YNH_APP_INSTANCE_NAME #================================================= # SPECIFIC RESTORE #================================================= # REINSTALL DEPENDENCIES #================================================= ynh_install_app_dependencies apticron unattended-upgrades apt-listchanges #================================================= # RESTORE UNATTENDED-UPGRADES CONFIG #================================================= ynh_restore_file "/etc/apt/apt.conf.d/50unattended-upgrades" # Restore also the backup config file ynh_restore_file "/etc/apt/50unattended-upgrades.backup" #================================================= # RESTORE APT PERIODIC #================================================= ynh_restore_file "/etc/apt/apt.conf.d/02periodic" #================================================= # RESTORE APTICRON CONFIG #================================================= ynh_restore_file "/etc/apticron/apticron.conf" #================================================= # RESTORE THE CRON FILE #================================================= ynh_restore_file "/etc/cron.d/apticron" #================================================= # GENERIC FINALISATION #================================================= # SEND A README FOR THE ADMIN #================================================= 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 Unattended-upgrades will be executed every day at midnight. 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 /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" ynh_send_readme_to_admin --app_message="$message" --recipients="root"