back to scripts

update-os.sh

bash 17 lines secrets redacted

Applies OS package updates on the host.

Note Live script from my home-lab server. Tokens, IDs, phone numbers and other secrets have been replaced with placeholders like <WHATSAPP_GROUP_ID> — everything else is the real, running code.
#!/bin/bash

LOG="$HOME/docker/os-update.log"

echo "=== OS Update Started: $(date) ===" | tee -a "$LOG"

sudo apt update 2>&1 | tee -a "$LOG"
sudo apt full-upgrade -y 2>&1 | tee -a "$LOG"
sudo apt autoremove -y 2>&1 | tee -a "$LOG"

if [ -f /var/run/reboot-required ]; then
  echo "REBOOT REQUIRED" | tee -a "$LOG"
else
  echo "No reboot needed" | tee -a "$LOG"
fi

echo "=== OS Update Finished: $(date) ===" | tee -a "$LOG"

back to scripts