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

Add System Update and Upgrade Automation Script #62

Open
wants to merge 1 commit into
base: master
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
21 changes: 21 additions & 0 deletions scripts/systemupdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

sudo apt-get update -y

if [[ $(apt list --upgradable 2>/dev/null | grep -c 'upgradable') -gt 0 ]]; then

sudo apt-get upgrade -y

if [[ $? -eq 0 ]]; then
echo "*** Upgrade done successfully ***"
else
echo "*** Upgrade failed ***"
exit 1
fi

else
echo "*** No upgrades were found ***"
fi

#After creating this bash file go to .bashrc file in the home directory to perform command alias.
#So instead of typing the file name everytime to update, you can use any simple words