From 9af038cadef0396f1cae5c685716b41f9dfa4392 Mon Sep 17 00:00:00 2001 From: allan Date: Sun, 25 May 2025 10:39:51 +0000 Subject: [PATCH] minor changes --- configure-updates | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure-updates b/configure-updates index 3fab2e9..7c66037 100755 --- a/configure-updates +++ b/configure-updates @@ -12,10 +12,11 @@ if [[ $(id -u) -ne 0 ]]; then printf "\nMust be root or use sudo!\n\n"; exit; fi # Are we in the right directory # scriptdir="unattended-updates" && whereami=$(pwd |awk -F'/' '{print $NF}') -if [ $whereami != $scriptdir ]; then printf "\nWrong directory! Script must be run from $scriptdir\n\n"; exit 1; fi +if [ "$whereami" != "$scriptdir" ]; then printf "\nWrong directory! Script must be run from %s\n\n" "$scriptdir"; exit 1; fi # # Define variables and functions # +line () { printf -- '-%.0s' {1..50}; printf '\n'; } config1="/etc/apt/apt.conf.d/20auto-upgrades" config1alt="/usr/share/unattended-upgrades/20auto-upgrades" config2="/etc/apt/apt.conf.d/50unattended-upgrades" @@ -37,8 +38,8 @@ config="$config2" ; configalt="$config2alt" ; chkcfg $config $configalt # # Back up configuration files. # -cp -Rp /etc/apt/apt.conf.d/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades.orig -cp -Rp /etc/apt/apt.conf.d/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades.orig +cp -Rp /etc/apt/apt.conf.d/20auto-upgrades /root/20auto-upgrades.orig +cp -Rp /etc/apt/apt.conf.d/50unattended-upgrades /root/50unattended-upgrades.orig # # Disable automatic updates. We want to be in control instead of letting the system do this randomly twice a day. # @@ -77,5 +78,9 @@ echo "$cronjob01" > /etc/cron.d/updatesystem systemctl restart unattended-upgrades.service systemctl restart cron.service # +# All done display output +# +clear ; printf "\n" ; line ; printf "All Done...\n" ; line ; printf "\n" +# # End of script #