1
0
Fork 0

fix color

This commit is contained in:
VirtuBox 2018-09-13 17:28:06 +02:00
parent 51b17448bb
commit 255d120ec2
1 changed files with 14 additions and 14 deletions

View File

@ -68,32 +68,32 @@ MAINTENANCE_APT() {
CRED="${CSI}1;31m"
CGREEN="${CSI}1;32m"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT UPDATE '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
## Updates package lists
sudo apt update
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT FULL-UPGRADE '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
## Updates packages and libraries
sudo apt full-upgrade -y
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT-GET AUTOREMOVE '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
## Removes unneeded packages
sudo apt-get -y --purge autoremove
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' DEBORPHAN '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
## Removes unused config files
if [ ! -x /usr/bin/deborphan ]; then
apt install deborphan -y
fi
sudo deborphan -n --find-config | xargs sudo apt-get -y --purge autoremove
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT AUTOCLEAN '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
## Removes package files that can no longer be downloaded and everything except
# the lock file in /var/cache/apt/archives, including directories.
sudo apt-get -y autoclean
@ -101,15 +101,15 @@ MAINTENANCE_APT() {
## clean packages in deinstall state
DEINSTALLED=$(sudo dpkg --get-selections | grep deinstall | cut -f1)
if [ ! -z "$DEINSTALLED" ]; then
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' CLEAN DEINSTALL PACKAGES '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
sudo dpkg --get-selections | grep deinstall | cut -f1 | xargs dpkg --purge
fi
if [ -x /usr/bin/docker ]; then
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' DOCKER CLEANUP '
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e "${CGREEN}#############################################${CEND}"
list_images=$(docker images --filter "dangling=true" -q --no-trunc)
list_volumes=$(docker volume ls -qf dangling=true)
if [ ! -z "$list_images" ]; then