Created
December 19, 2017 03:32
-
-
Save rubenbruno89/1c0e764f87b6862e57ea4c500b100bea to your computer and use it in GitHub Desktop.
Instalar ou Reparar o Grup 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MENU () { | |
clear | |
echo | |
echo " MENU " | |
echo | |
echo | |
echo " 1 - Instalando o GRUB " | |
echo " 2 - Instalar o GRUB Customizer" | |
echo " 3 - Mudar o Nome da Maquina " | |
echo | |
echo " S - Sair " | |
echo | |
echo | |
read -p "Informe o número da opção desejada : " num | |
case $num in | |
1) | |
sudo fdisk -l | |
echo | |
read -p "Informe o número da apartição que o linux esta usado: " part | |
sudo mount -t ext4 /dev/sda$part /mnt | |
echo | |
sudo grub-install --root-directory=/mnt /dev/sda | |
echo | |
MENU | |
;; | |
2) | |
echo | |
sudo add-apt-repository ppa:danielrichter2007/grub-customizer && sudo apt-get update && sudo apt-get install grub-customizer | |
echo | |
MENU | |
;; | |
3) | |
read -p "Informe o Nome da Maquina: " name | |
sudo hostname $name | |
hostname | |
echo | |
MENU | |
;; | |
S) | |
echo | |
echo "Você escolheu SAIR" | |
echo | |
exit | |
;; | |
*) | |
echo | |
echo "Não entendi sua opção. Carectere inesperado!" | |
echo "Pressione qualquer tecla para continuar!" | |
pausa | |
MENU | |
;; | |
esac | |
echo | |
} | |
pausa () { | |
read -p "$*" | |
} | |
MENU |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment