Last active
February 9, 2016 04:02
-
-
Save kurobeats/7ded42be7b17e3a6b55f to your computer and use it in GitHub Desktop.
bashrc_functions
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
#----------------------------------- | |
# Maintaince functions: | |
#----------------------------------- | |
#update computer | |
function update() { | |
if [ -f /usr/bin/pacman ]; then | |
if [ -f /usr/bin/yaourt ]; then | |
yaourt -Syua; | |
else | |
sudo pacman -Syu; | |
fi | |
fi | |
if [ -f /usr/bin/apt-get ]; then | |
sudo apt-get update && sudo apt-get dist-upgrade | |
fi | |
} | |
#installing stuff | |
function install() { | |
for package in "$@" | |
do | |
if [ -f /usr/bin/pacman ]; then | |
if [ -f /usr/bin/yaourt ]; then | |
yaourt -S $package; | |
else | |
sudo pacman -S $package; | |
fi | |
fi | |
if [ -f /usr/bin/apt-get ]; then | |
sudo apt-get install $package; | |
fi | |
done | |
} | |
#remove stuff | |
function remove() { | |
for package in "$@" | |
do | |
if [ -f /usr/bin/pacman ]; then | |
if [ -f /usr/bin/yaourt ]; then | |
yaourt -R $package && clean; | |
else | |
sudo pacman -Rc $package && clean; | |
fi | |
fi | |
if [ -f /usr/bin/apt-get ]; then | |
sudo apt-get remove $package && clean; | |
fi | |
done | |
} | |
#cleaning bullshit old packages | |
function clean() { | |
if [ -f /usr/bin/pacman ]; then | |
sudo pacman -Scc && pacman -Qdtq | sudo pacman -Rs -; | |
fi | |
if [ -f /usr/bin/apt-get ]; then | |
sudo apt-get autoremove && sudo apt-get clean && sudo apt-get autoclean; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment