Update clean.sh

code refactoring
This commit is contained in:
tteckster 2023-09-13 11:48:21 -04:00 committed by GitHub
parent 14390c0e9e
commit 975bce31ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 26 deletions

View File

@ -27,17 +27,11 @@ if [[ -z "$cache" ]]; then
echo -e "It appears there are no cached files on your system. \n" echo -e "It appears there are no cached files on your system. \n"
sleep 2 sleep 2
else else
echo -e "$cache \n" echo "Removing Cache"
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 find /var/cache -type f -delete
echo "Successfully Removed cache" echo "Successfully Removed Cache"
sleep 2 sleep 2
fi fi
fi
header_info header_info
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n" echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
logs=$(find /var/log/ -type f) logs=$(find /var/log/ -type f)
@ -45,17 +39,11 @@ if [[ -z "$logs" ]]; then
echo -e "It appears there are no logs on your system. \n" echo -e "It appears there are no logs on your system. \n"
sleep 2 sleep 2
else else
echo -e "$logs \n" echo "Removing Logs"
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 find /var/log -type f -delete
echo "Successfully Removed logs" echo "Successfully Removed Logs"
sleep 2 sleep 2
fi fi
fi
header_info header_info
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n" echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
echo -e "${GN}Populating apt lists${CL} \n" echo -e "${GN}Populating apt lists${CL} \n"