1
0
Fork 0

fix color

This commit is contained in:
VirtuBox 2018-09-13 17:27:22 +02:00
parent 3ae489cc79
commit 51b17448bb
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 "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' APT UPDATE '
echo "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
## Updates package lists
sudo apt update
echo "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' APT FULL-UPGRADE '
echo "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
## Updates packages and libraries
sudo apt full-upgrade -y
echo "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' APT-GET AUTOREMOVE '
echo "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
## Removes unneeded packages
sudo apt-get -y --purge autoremove
echo "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' DEBORPHAN '
echo "[${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 "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' APT AUTOCLEAN '
echo "[${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 "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' CLEAN DEINSTALL PACKAGES '
echo "[${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 "[${CGREEN}#############################################${CEND}]"
echo -e "[${CGREEN}#############################################${CEND}]"
echo -e ' DOCKER CLEANUP '
echo "[${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