Last active
April 20, 2020 14:48
-
-
Save mansouryaacoubi/08a8e6a2465e77352cea6cf924414744 to your computer and use it in GitHub Desktop.
Updates and upgrades system and Raspberry Pi and installs specific programs and modules
This file contains hidden or 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 | |
# @author Mansour Yaacoubi | |
# @filename update-rpi.sh | |
# @task Installs new updates and specific programs | |
################# CHECK WHETHER SCRIPT IS RUNNING AS ROOT ################# | |
# Run script as root (higher privileges) | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit 1 | |
else | |
clear | |
echo | |
echo "Script is running with higher privileges as: $SUDO_USER -> $(whoami)" | |
echo | |
fi | |
echo "-> apt-get update -y" | |
apt-get update -y | |
apt-get install python python-pip python3 python3-pip -y | |
echo "-> apt-get upgrade -y" | |
apt-get upgrade -y | |
echo "-> apt-get dist-upgrade -y" | |
apt-get dist-upgrade -y | |
echo "-> apt-get clean" | |
apt-get clean | |
echo "-> apt-get --purge -y autoremove" | |
apt-get --purge -y autoremove | |
echo "-> rpi-update" | |
rpi-update | |
echo "-> reboot" | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment