mirror of https://github.com/tteck/Proxmox.git
				
				
				
			
							parent
							
								
									c9e3b72dfa
								
							
						
					
					
						commit
						6b3d7a7bf8
					
				| 
						 | 
				
			
			@ -1,5 +1,6 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
function header_info {
 | 
			
		||||
 | 
			
		||||
function header_info() {
 | 
			
		||||
  cat <<"EOF"
 | 
			
		||||
   ________                    __   _  ________
 | 
			
		||||
  / ____/ /__  ____ _____     / /  | |/ / ____/
 | 
			
		||||
| 
						 | 
				
			
			@ -9,18 +10,22 @@ function header_info {
 | 
			
		|||
                                               
 | 
			
		||||
EOF
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
BL=$(echo "\033[36m")
 | 
			
		||||
GN=$(echo "\033[1;92m")
 | 
			
		||||
CL=$(echo "\033[m")
 | 
			
		||||
name=$(hostname)
 | 
			
		||||
 | 
			
		||||
clear
 | 
			
		||||
header_info
 | 
			
		||||
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
 | 
			
		||||
 | 
			
		||||
# Clean cache
 | 
			
		||||
cache=$(find /var/cache/ -type f)
 | 
			
		||||
    if [[ -z "$cache" ]]; then
 | 
			
		||||
if [[ -z "$cache" ]]; then
 | 
			
		||||
  echo -e "It appears there are no cached files on your system. \n"
 | 
			
		||||
  sleep 2
 | 
			
		||||
    else
 | 
			
		||||
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
 | 
			
		||||
| 
						 | 
				
			
			@ -31,15 +36,17 @@ cache=$(find /var/cache/ -type f)
 | 
			
		|||
    echo "Successfully Removed cache"
 | 
			
		||||
    sleep 2
 | 
			
		||||
  fi
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Clean logs
 | 
			
		||||
clear
 | 
			
		||||
header_info
 | 
			
		||||
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
 | 
			
		||||
logs=$(find /var/log/ -type f)
 | 
			
		||||
    if [[ -z "$logs" ]]; then
 | 
			
		||||
if [[ -z "$logs" ]]; then
 | 
			
		||||
  echo -e "It appears there are no logs on your system. \n"
 | 
			
		||||
  sleep 2
 | 
			
		||||
    else
 | 
			
		||||
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
 | 
			
		||||
| 
						 | 
				
			
			@ -50,8 +57,10 @@ logs=$(find /var/log/ -type f)
 | 
			
		|||
    echo "Successfully Removed logs"
 | 
			
		||||
    sleep 2
 | 
			
		||||
  fi
 | 
			
		||||
    fi
 | 
			
		||||
    clear
 | 
			
		||||
    header_info
 | 
			
		||||
    echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
 | 
			
		||||
    echo -e "${GN}Populating apt lists${CL} \n"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Populate apt lists
 | 
			
		||||
clear
 | 
			
		||||
header_info
 | 
			
		||||
echo -e "${BL}[Info]${GN} Cleaning $name${CL} \n"
 | 
			
		||||
echo -e "${GN}Populating apt lists${CL} \n"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue