Created
March 24, 2021 22:15
-
-
Save GiovanniGrieco/d430c3a4143dc13256d8d6242e0c29bd to your computer and use it in GitHub Desktop.
Automatically upgrade Raspberry Pi OS software packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$EUID" -ne "0" ]; then | |
echo "Please run this script as root." | |
exit 1 | |
fi | |
export DEBIAN_FRONTEND=noninteractive | |
apt update | |
SPECIAL_PKGS=$(apt list --upgradable | egrep "(firmware|kernel)") | |
apt upgrade -y | |
if [ ! -z "$SPECIAL_PKGS" ]; then | |
reboot | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment