From c00505414159836792bcadbc528b5ec1cb76024e Mon Sep 17 00:00:00 2001 From: allan Date: Sat, 6 Dec 2025 10:25:35 +0100 Subject: [PATCH] comment corrections only no code changes --- auto-update-ubuntu | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/auto-update-ubuntu b/auto-update-ubuntu index 10f0b66..79c5515 100755 --- a/auto-update-ubuntu +++ b/auto-update-ubuntu @@ -1,9 +1,8 @@ #!/usr/bin/env bash -# SPDX-License-Identifier: MIT # Author : Allan Christensen # First Created : 23062022 (DD-MM-YYYY) -# Description : Configures unattended updates on on Ubuntu 24.04 +# Description : Configures unattended updates on Ubuntu 24.04 # License : MIT License (see LICENSE file for details) # @@ -20,7 +19,7 @@ config2="/etc/apt/apt.conf.d/50unattended-upgrades" config2alt="/usr/share/unattended-upgrades/50unattended-upgrades" # -# Function to check if config exists, else copy from alternative location +# Function to check if config exists, if not, copy from alternative location # chkcfg () { if [ ! -f "$1" ]; then echo "Config missing: $1 → copying from $2" ; cp -Rp "$2" "$1" ; fi; } @@ -52,7 +51,7 @@ sed -i 's/^\(APT::Periodic::Unattended-Upgrade\s*"\)1"/\10"/' "$config1" sed -i '/Unattended-Upgrade::Allowed-Origins/ s|//\s*"\${distro_id}:\${distro_codename}-updates"|"\${distro_id}:\${distro_codename}-updates"|' "$config2" # -# Uncomment the next 2 lines to enable automatic removal of unused packages this equals apt autoremove +# Uncomment the next 2 lines to enable automatic removal of unused packages equivalent to apt autoremove # # sed -i '/Unattended-Upgrade::Remove-Unused-Dependencies/ s/^\/\/\s*//' "$config2" # sed -i 's/Remove-Unused-Dependencies "false"/Remove-Unused-Dependencies "true"/' "$config2" @@ -64,18 +63,18 @@ sed -i '/Unattended-Upgrade::Allowed-Origins/ s|//\s*"\${distro_id}:\${distro_co # sed -i 's/Automatic-Reboot "false"/Automatic-Reboot "true"/' "$config2" # -# Uncomment the line below to enable automatic rebbot even if users are logged in +# Uncomment the line below to enable automatic reboot even if users are logged in # # sed -i '/Unattended-Upgrade::Automatic-Reboot-WithUsers/ s/^\/\/\s*//' "$config2" # -# Create cronjob running every Sunday at 04:00 +# Create cron job running every Sunday at 04:00 # cronfile="/etc/cron.d/updatesystem" cronjob='0 4 * * 0 root /usr/bin/apt update && /usr/bin/unattended-upgrade -v >/dev/null 2>&1' # -# Restart unatended upgrades and cron. +# Restart unattended upgrades and cron. # systemctl restart unattended-upgrades.service ; systemctl restart cron.service