Remove Automaticamente os Kernel Antigos do GRUB
Publicado por William Lima Reiznautt 23/08/2006
[ Hits: 7.072 ]
Esse Script faz uma varedura no arquivo /etc/grub.conf e remove o Kernel mais antigos deles, e define o Default = 0, Bom para quem atualiza varias maquinas, obs: esse Script esta configurado para o FEDORA CORE 4, se precisar rodar em outra versao, é so alterar o 'egrep'
#!/bin/bash
## Desenvolvido por www.vivaolinux.com.br/~willreli ##
## Data Desenvolvimento 15/03/06 ##
## Atualização 15/03/06 ##
##Manter DEFAULT=0
sed -e 's/^default=[^0]/default=0/' /etc/grub.conf > /tmp/testeker.txt && cat /tmp/testeker.txt > /etc/grub.conf
##Apaga entrada não SMP
sed -e '/^title Fedora Core.*FC4)$/,+3d' arqaux/grub2.conf > /tmp/testeker.txt && cat /tmp/testeker.txt > ~/scripts/arqaux/grub2.conf
##Remove Kernel Mais Antigo
if [ $(egrep -c '^title Fedora Core' arqaux/grub2.conf) -gt 1 ]; then
arm=$(cat arqaux/grub2.conf | egrep '^title Fedora' | sort | head -1 | awk '{print $4}')
sed -e '/'$arm'$/,+3d' /etc/grub.conf > /tmp/testeker.txt && cat /tmp/testeker.txt > /etc/grub.conf
./rmkernel.sh
fi
cat /etc/grub.conf
substituir strings nos nomes de arquivos
Testa a conexão com a internet e se não tem reinicia o pc.
Nenhum comentário foi encontrado.
LazyDocker – Interface de Usuário em Tempo Real para o Docker
Instalando COSMIC no Linux Mint
Turbinando o Linux Mint: o poder das Nemo Actions
Inteligência Artificial no desenvolvimento de software: quando começar a usar?
O widget do Plasma 6 Área de Notificação
[Resolvido] Algo deu errado ao abrir seu perfil
Quando vocês pararam de testar distros? (14)
Problema com som no laptop (3)
Não estou conseguindo fazer funcionar meu Postfix na versão 2.4 no Deb... (2)









