Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash script for OS upgrade #198

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions PPPwn/patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e

if [ -f /boot/firmware/pppwn/patch.log ]; then
sudo rm -rf /boot/firmware/pppwn/patch.log
fi

patching(){
if ! command -v nala 2>&1 >/dev/null
then
echo -e "First time run, you will only see this once!\n"
echo -e "Doing APT update...\n"
sudo apt-get update
echo -e "\nInstalling Nala...\n"
sudo apt-get install nala -y
echo -e "\nRunning Raspbian upgrade...\n"
sudo DEBIAN_FRONTEND=noninteractive nala upgrade -y
echo -e "\nAll set!"
else
echo -e "\nRunning Raspbian upgrade...\n"
sudo DEBIAN_FRONTEND=noninteractive nala upgrade -y
echo -e "\nAll set!"
fi
};


patching | sudo tee /dev/tty1 | sudo tee /dev/pts/* | sudo tee -a /boot/firmware/pppwn/patch.log
exit 0