You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

2 years ago
#!/usr/bin/env bash
function header_info() {
clear
cat <<"EOF"
2 years ago
________ __ _ ________
/ ____/ /__ ____ _____ / / | |/ / ____/
/ / / / _ \/ __ `/ __ \ / / | / /
/ /___/ / __/ /_/ / / / / / /___/ / /___
\____/_/\___/\__,_/_/ /_/ /_____/_/|_\____/
EOF
}
BL=$(echo "\033[36m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
name=$(hostname)
header_info
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
2 years ago
cache=$(find /var/cache/ -type f)
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"
2 years ago
sleep 2
fi
fi
2 years ago
header_info
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
2 years ago
logs=$(find /var/log/ -type f)
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}"
2 years ago
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"
2 years ago
sleep 2
fi
fi
header_info
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
echo -e "${GN}Populating apt lists${CL} \n"

Powered by BW's shoe-string budget.