Created
January 7, 2016 10:53
-
-
Save G10DRAS/1d0d150271512ac2c588 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}') | |
YELLOW="\033[1;33m" | |
RED="\033[0;31m" | |
ENDCOLOR="\033[0m" | |
if [ $USER != root ]; then | |
echo -e $RED"Error: must be root" | |
echo -e $YELLOW"Exiting..."$ENDCOLOR | |
exit 0 | |
fi | |
echo -e $YELLOW"Cleaning apt cache..."$ENDCOLOR | |
sudo aptitude clean | |
echo -e $YELLOW"Removing old config files..."$ENDCOLOR | |
sudo aptitude purge $OLDCONF | |
echo -e $YELLOW"Emptying every trashes..."$ENDCOLOR | |
sudo rm -rf /home/*/.local/share/Trash/*/** &> /dev/null | |
sudo rm -rf /root/.local/share/Trash/*/** &> /dev/null | |
echo -e $YELLOW"Script Finished!"$ENDCOLOR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment