Skip to content

Instantly share code, notes, and snippets.

@mbifulco
Forked from andrewpmiller/piupdate.sh
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbifulco/3b224599b3f41409952f to your computer and use it in GitHub Desktop.
Save mbifulco/3b224599b3f41409952f to your computer and use it in GitHub Desktop.
#!/bin/bash
# ------------------------------------------------------------------
# Title: piupdate.sh
# Author: Andrew Miller (updated by Mike Bifulco)
# Version: 0.1.2
#
# Description:
# A really simple script that runs through all of the usual updates
# for a Raspbian Raspberry Pi.
#
# Note: Use the -f flag to check and update the firmware
# (Requires https://github.com/Hexxeh/rpi-update)
# ------------------------------------------------------------------
date
echo "$(tput setaf 1)Checking for rpi-update install...$(tput sgr0)"
sudo apt-get install rpi-update
echo "$(tput setaf 1)Checking for system software updates...$(tput sgr0)"
sudo apt-get update
echo "$(tput setaf 1)Updating system software...$(tput sgr0)"
sudo apt-get upgrade
echo "$(tput setaf 1)Updating distribution software...$(tput sgr0)"
sudo apt-get dist-upgrade
echo "$(tput setaf 1)Cleaning up...$(tput sgr0)"
sudo apt-get autoremove --purge
if [ "$1" = "-f" ]
then
echo "$(tput setaf 1)Checking and updating firmware...$(tput sgr0)"
sudo rpi-update
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment