Last active
October 20, 2017 01:56
-
-
Save socheatsok78/929397226e1c3a77687fad21d246fec7 to your computer and use it in GitHub Desktop.
Home-made Baked bake.sh script for the day
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
function bake { | |
case $1 in | |
update) | |
echo "Checking for update...\n---" | |
sudo apt-get update -y | |
echo "\nAvailable update packages...\n---" | |
sudo apt list --upgradable ;; | |
upgrade) | |
echo "Upgrading new packages...\n---" | |
sudo apt-get dist-upgrade | |
echo "\nRemoving old packages...\n---" | |
sudo apt autoremove | |
echo "\nCleaning up...\n---" | |
sudo apt autoclean ;; | |
help) echo "Bake help:\n---\nupdate:\t\tAlias for apt-get update\nupgrade:\tAlias for apt-get dist-upgrade\nhelp:\t\tDisplay this help document\n\nInstall deb package:\n---\nbake packagename.deb" ;; | |
*) if [ -f $1 ] ; then | |
sudo dpkg -i $1 | |
else | |
echo "Bake was unable to find $1 in the current directory..." | |
fi ;; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment