comment corrections only no code changes

This commit is contained in:
2025-12-06 10:25:35 +01:00
parent 1f5ddf954d
commit c005054141

View File

@@ -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