From 975bce31ba10f7a4d7a42180732562f3f259f2ac Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 13 Sep 2023 11:48:21 -0400 Subject: [PATCH] Update clean.sh code refactoring --- misc/clean.sh | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/misc/clean.sh b/misc/clean.sh index 1d32009e..8e223784 100644 --- a/misc/clean.sh +++ b/misc/clean.sh @@ -6,14 +6,14 @@ # https://github.com/tteck/Proxmox/raw/main/LICENSE function header_info() { -clear -cat <<"EOF" + clear + cat <<"EOF" ________ __ _ ________ / ____/ /__ ____ _____ / / | |/ / ____/ - / / / / _ \/ __ `/ __ \ / / | / / -/ /___/ / __/ /_/ / / / / / /___/ / /___ -\____/_/\___/\__,_/_/ /_/ /_____/_/|_\____/ - + / / / / _ \/ __ `/ __ \ / / | / / +/ /___/ / __/ /_/ / / / / / /___/ / /___ +\____/_/\___/\__,_/_/ /_/ /_____/_/|_\____/ + EOF } BL=$(echo "\033[36m") @@ -27,16 +27,10 @@ if [[ -z "$cache" ]]; then echo -e "It appears there are no cached files on your system. \n" sleep 2 else - echo -e "$cache \n" - echo -e "${GN}Cache in $name${CL}" - read -p "Would you like to remove the selected cache listed above? [y/N] " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Removing cache" - find /var/cache -type f -delete - echo "Successfully Removed cache" - sleep 2 - fi + echo "Removing Cache" + find /var/cache -type f -delete + echo "Successfully Removed Cache" + sleep 2 fi header_info echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n" @@ -45,16 +39,10 @@ if [[ -z "$logs" ]]; then echo -e "It appears there are no logs on your system. \n" sleep 2 else - echo -e "$logs \n" - echo -e "${GN}Logs in $name${CL}" - read -p "Would you like to remove the selected logs listed above? [y/N] " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - echo "Removing logs" - find /var/log -type f -delete - echo "Successfully Removed logs" - sleep 2 - fi + echo "Removing Logs" + find /var/log -type f -delete + echo "Successfully Removed Logs" + sleep 2 fi header_info echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"