#!/bin/bash

tput setaf 2; echo "------------------------------------"  ; tput sgr0
tput setaf 2; echo "|       Vamos limpar sua vps       |"  ; tput sgr0
tput setaf 2; echo "|            Velox Vps             |"  ; tput sgr0
tput setaf 2; echo "|        suporte @Flavio-Gomes         |"  ; tput sgr0
tput setaf 2; echo "------------------------------------"  ; tput sgr0

sleep 3.5

tput setaf 2; echo "Quantidade de memória de seu servidor"  ; tput sgr0

free -h

tput setaf 2;echo "Digite yes para continuar!"  ; tput sgr0

read yes

echo 3 | tee /proc/sys/vm/drop_caches apt-get clean && apt-get autoclean

sudo apt-get autoremove

sudo apt-get install deborphan -y

sudo apt-get remove $(deborphan)

sync && echo 1 > /proc/sys/vm/drop_caches

sync && echo 2 > /proc/sys/vm/drop_caches

sync && echo 3 > /proc/sys/vm/drop_caches

clear

tput setaf 2; echo "A limpeza no seu servidor foi realizada com sucesso!"  ; tput sgr0

free -h

du -sh /var/cache/apt/archives

sleep 3

apt-get clean

echo

tput setaf 2; echo "Fim da limpeza"  ; tput sgr0

tput setaf 2; echo "Seu servidor sera reiniciado em 4 segundos"  ; tput sgr0
sleep 4s
reboot
