Created
January 30, 2017 02:09
-
-
Save greenmind-sec/c58a05923b57748dc151636b38822ab1 to your computer and use it in GitHub Desktop.
Arquivo de instalação do easy-server
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 | |
# install.sh | |
# | |
# | |
# GreenMind, Janeiro de 2017 | |
# | |
#------------------------------- | |
# Mensagens | |
#------------------------------- | |
HELP=" | |
Uso: $(basename "$0") [OPÇÕES] | |
OPÇÕES: | |
$(basename "$0") Chama o help | |
-ies, --install-easyserver Instala o Easy Server | |
-h, --help Mostra esta tela de ajuda | |
-m, --man Manual completo do programa | |
" | |
MAN=" | |
-ies, --Install-easyserver Instala o Easy Server | |
-h, --help Mostra como usar os comandos para o blog | |
-m, --man Mostra o manual completo para auxiliar no uso do GreenMindCMS | |
" | |
#------------------------------- | |
#Funções | |
#------------------------------- | |
function install_requisitos_easyserver() { | |
echo "Deseja instalar requisitos?" | |
echo " [ S ] Sim" | |
echo " [ N ] Não" | |
read escolha | |
if [[ "$escolha" -eq "S" ]] | |
then | |
apt-get install -y tar git | |
echo "Os requisitos foram instalados com sucesso!" | |
else | |
echo "É necessario instalar os requisitos" | |
exit 0 | |
fi | |
} | |
#Função Install Easy Server | |
function install_easyserver(){ | |
echo "Instalando Easy Server" | |
cp easy-server.sh /bin/easy-server | |
chmod +x /bin/easy-server | |
echo "Easy Servers instalado com sucesso!" | |
exit 0 | |
} | |
#Função help | |
function help(){ | |
echo "$HELP"; | |
exit 0 | |
} | |
#Função man | |
function man(){ | |
echo $(basename "$0") ; | |
echo "$MAN" | |
exit 0 | |
} | |
#------------------------------- | |
#Menu | |
#------------------------------- | |
case "$1" in | |
#Manual | |
-m | --man) | |
man | |
;; | |
#Ajuda | |
-h | --help) | |
help | |
;; | |
#Instalando Easy Server | |
-ies | --install-easyserver) | |
install_requisitos_easyserver | |
install_easyserver | |
;; | |
*) | |
#Caso não passar nenhum parametro informa opção invalida. | |
echo Opção inválida: $1 | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment