Skip to content

Commit

Permalink
corrigido alguns bugs nos arquivos
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-Victor-Liporini committed Mar 18, 2023
1 parent af10dcb commit d2780ec
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ execute() {
if [[ -n $2 ]]; then
echo -e -n "* Instalação do $1 concluído. Deseja proceder à instalação do $2? (s/N): "
read -r CONFIRM
if [[ "$CONFIRM" =~ [Ss] ]]; then
if [[ "$CONFIRM" =~ [SsYy] ]]; then
execute "$2"
else
error "Instalação do $2 abortada."
Expand All @@ -73,10 +73,10 @@ welcome ""
done=false
while [ "$done" == false ]; do
options=(
"Instalar o painel"
"Instalar o Painel"
"Instalar o Wings"
"Instalar ambos [0] e [1] na mesma máquina (o roteiro das asas corre depois do painel)"
"Desinstalar painel ou wings\n"
"Instalar ambos [0] e [1] na mesma máquina (o script do wings funciona depois do painel)"
"Desinstalar painel ou wings\n *"

"Instalar o Painel com versão canária do script (as versões que vivem em mestre, podem ser quebradas!)"
"Instalar o Wings com versão canária do script (as versões que vivem em mestre, podem ser quebradas!)"
Expand Down
4 changes: 2 additions & 2 deletions installers/desinstalar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ rm_database() {
valid_db=$(mysql -u root -e "SELECT schema_name FROM information_schema.schemata;" | grep -v -E -- 'schema_name|information_schema|performance_schema|mysql')
warning "Be careful! This database will be deleted!"
if [[ "$valid_db" == *"panel"* ]]; then
echo -n "* Database called panel has been detected. Is it the pterodactyl database? (y/N): "
echo -n "* Foi detectada uma database chamada painel. Ela é a database do pterodactyl? (s/N): "
read -r is_panel
if [[ "$is_panel" =~ [Yy] ]]; then
if [[ "$is_panel" =~ [SsYy] ]]; then
DATABASE=panel
else
print_list "$valid_db"
Expand Down
4 changes: 2 additions & 2 deletions installers/painel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fi
FQDN="${FQDN:-localhost}"

# Default MySQL credentials
MYSQL_DB="${MYSQL_DB:-panel}"
MYSQL_DB="${MYSQL_DB:-painel}"
MYSQL_USER="${MYSQL_USER:-pterodactyl}"
MYSQL_PASSWORD="${MYSQL_PASSWORD:-$(gen_passwd 64)}"

Expand Down Expand Up @@ -358,7 +358,7 @@ letsencrypt() {
echo -n "* Continuar Configurando o SSL? (s/N): "
read -r CONFIGURE_SSL

if [[ "$CONFIGURE_SSL" =~ [Ss] ]]; then
if [[ "$CONFIGURE_SSL" =~ [SsYy] ]]; then
ASSUME_SSL=true
CONFIGURE_LETSENCRYPT=false
configure_nginx
Expand Down
2 changes: 1 addition & 1 deletion installers/wings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ EMAIL="${EMAIL:-}"
CONFIGURE_DBHOST="${CONFIGURE_DBHOST:-false}"
CONFIGURE_DB_FIREWALL="${CONFIGURE_DB_FIREWALL:-false}"
MYSQL_DBHOST_HOST="${MYSQL_DBHOST_HOST:-127.0.0.1}"
MYSQL_DBHOST_USER="${MYSQL_DBHOST_USER:-pterodactyluser}"
MYSQL_DBHOST_USER="${MYSQL_DBHOST_USER:-usuariopterodactyl}"
MYSQL_DBHOST_PASSWORD="${MYSQL_DBHOST_PASSWORD:-}"

if [[ $CONFIGURE_DBHOST == true && -z "${MYSQL_DBHOST_PASSWORD}" ]]; then
Expand Down
6 changes: 3 additions & 3 deletions lib/biblioteca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ ask_firewall() {
echo -e -n "* Deseja configurar automaticamente o UFW (firewall)? (s/N): "
read -r CONFIRM_UFW

if [[ "$CONFIRM_UFW" =~ [Ss] ]]; then
if [[ "$CONFIRM_UFW" =~ [SsYy] ]]; then
eval "$__resultvar="'true'""
fi
;;
rocky | almalinux)
echo -e -n "* Deseja configurar automaticamente o firewall-cmd (firewall)? (s/N): "
read -r CONFIRM_FIREWALL_CMD

if [[ "$CONFIRM_FIREWALL_CMD" =~ [Ss] ]]; then
if [[ "$CONFIRM_FIREWALL_CMD" =~ [SsYy] ]]; then
eval "$__resultvar="'true'""
fi
;;
Expand Down Expand Up @@ -432,7 +432,7 @@ check_os_x86_64() {
echo -e -n "* Tem certeza que quer prosseguir? (s/N):"
read -r choice

if [[ ! "$choice" =~ [Ss] ]]; then
if [[ ! "$choice" =~ [SsYy] ]]; then
error "Instalação abortada!"
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions lib/verify-fqdn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fail() {
echo -n "* Continue de qualquer forma (a sua instalação será interrompida se não souber o que está fazendo)? (s/N): "
read -r override

[[ ! "$override" =~ [Ss] ]] && error "Registo SRV (FQDN) ou DNS inválido" && exit 1
[[ ! "$override" =~ [SsYy] ]] && error "Registo SRV (FQDN) ou DNS inválido" && exit 1
return 0
}

Expand All @@ -83,7 +83,7 @@ confirm() {

echo -e -n "* Concordo que este pedido HTTPS seja realizado (s/N): "
read -r confirm
[[ "$confirm" =~ [Ss] ]] || (error "O utilizador não concordou" && false)
[[ "$confirm" =~ [SsYy] ]] || (error "O utilizador não concordou" && false)
}

dns_verify() {
Expand Down
6 changes: 3 additions & 3 deletions ui/desinstalar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ main() {
output "A instalação do painel foi detectada."
echo -e -n "* Quer remover o painel? (s/N): "
read -r RM_PANEL_INPUT
[[ "$RM_PANEL_INPUT" =~ [Ss] ]] && RM_PANEL=true
[[ "$RM_PANEL_INPUT" =~ [SsYy] ]] && RM_PANEL=true
fi

if [ -d "/etc/pterodactyl" ]; then
output "Foi detectada a instalação do wings."
warning "Isto irá remover todos os servidores!"
echo -e -n "* Quer remover o wings (daemon)? (s/N): "
read -r RM_WINGS_INPUT
[[ "$RM_WINGS_INPUT" =~ [Ss] ]] && RM_WINGS=true
[[ "$RM_WINGS_INPUT" =~ [SsYy] ]] && RM_WINGS=true
fi

if [ "$RM_PANEL" == false ] && [ "$RM_WINGS" == false ]; then
Expand All @@ -74,7 +74,7 @@ main() {
# confirm uninstallation
echo -e -n "* Continuar com a desinstalação? (s/N): "
read -r CONFIRM
if [[ "$CONFIRM" =~ [Ss] ]]; then
if [[ "$CONFIRM" =~ [SsYy] ]]; then
run_installer "desinstalar"
else
error "Desinstalação abortada."
Expand Down
18 changes: 9 additions & 9 deletions ui/wings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set -e
fn_exists() { declare -F "$1" >/dev/null; }
if ! fn_exists lib_loaded; then
# shellcheck source=lib/lib.sh
source /tmp/lib.sh || source <(curl -sSL "$GITHUB_BASE_URL/$GITHUB_SOURCE"/lib/lib.sh)
source /tmp/biblioteca.sh || source <(curl -sSL "$GITHUB_BASE_URL/$GITHUB_SOURCE"/lib/biblioteca.sh)
! fn_exists lib_loaded && echo "* ERRO: Não foi possível carregar o script da biblioteca (biblioteca.sh)" && exit 1
fi

Expand All @@ -56,7 +56,7 @@ export EMAIL=""
export CONFIGURE_DBHOST=false
export CONFIGURE_DB_FIREWALL=false
export MYSQL_DBHOST_HOST="127.0.0.1"
export MYSQL_DBHOST_USER="pterodactyluser"
export MYSQL_DBHOST_USER="usuariopterodactyl"
export MYSQL_DBHOST_PASSWORD=""

# ------------ User input functions ------------ #
Expand All @@ -71,7 +71,7 @@ ask_letsencrypt() {
echo -e -n "* Quer configurar automaticamente HTTPS usando Let's Encrypt? (s/N): "
read -r CONFIRM_SSL

if [[ "$CONFIRM_SSL" =~ [Ss] ]]; then
if [[ "$CONFIRM_SSL" =~ [SsYy] ]]; then
CONFIGURE_LETSENCRYPT=true
fi
}
Expand All @@ -80,7 +80,7 @@ ask_database_user() {
echo -n "* Deseja configurar automaticamente um utilizador para a host da database? (s/N): "
read -r CONFIRM_DBHOST

if [[ "$CONFIRM_DBHOST" =~ [Ss] ]]; then
if [[ "$CONFIRM_DBHOST" =~ [SsYy] ]]; then
ask_database_external
CONFIGURE_DBHOST=true
fi
Expand All @@ -90,7 +90,7 @@ ask_database_external() {
echo -n "* Quer configurar o MySQL para ser conectado externamente? (s/N): "
read -r CONFIRM_DBEXTERNAL

if [[ "$CONFIRM_DBEXTERNAL" =~ [Ss] ]]; then
if [[ "$CONFIRM_DBEXTERNAL" =~ [SsYy] ]]; then
echo -n "* Introduza o endereço do painel (em branco para qualquer endereço): "
read -r CONFIRM_DBEXTERNAL_HOST
if [ "$CONFIRM_DBEXTERNAL_HOST" == "" ]; then
Expand All @@ -107,7 +107,7 @@ ask_database_firewall() {
warning "Permitir tráfego de entrada à porta 3306 (MySQL) pode ser potencialmente um risco de segurança, a menos que saiba o que está fazendo!"
echo -n "* Gostaria de permitir o tráfego de entrada para a porta 3306? (s/N): "
read -r CONFIRM_DB_FIREWALL
if [[ "$CONFIRM_DB_FIREWALL" =~ [Ss] ]]; then
if [[ "$CONFIRM_DB_FIREWALL" =~ [SsYy] ]]; then
CONFIGURE_DB_FIREWALL=true
fi
}
Expand All @@ -122,7 +122,7 @@ main() {
warning "O script detectou que já tem o Pterodactyl Wings no seu sistema! Não pode executar o script várias vezes, ele falhará!"
echo -e -n "* Tem certeza que quer prosseguir? (s/N): "
read -r CONFIRM_PROCEED
if [[ ! "$CONFIRM_PROCEED" =~ [Ss] ]]; then
if [[ ! "$CONFIRM_PROCEED" =~ [SsYy] ]]; then
error "Instalação abortada!"
exit 1
fi
Expand Down Expand Up @@ -180,7 +180,7 @@ main() {
[ "$ASK" == true ] && echo -e -n "* Ainda quer configurar automaticamente HTTPS usando Let's Encrypt? (s/N): "
[ "$ASK" == true ] && read -r CONFIRM_SSL

if [[ ! "$CONFIRM_SSL" =~ [Ss] ]] && [ "$ASK" == true ]; then
if [[ ! "$CONFIRM_SSL" =~ [SsYy] ]] && [ "$ASK" == true ]; then
CONFIGURE_LETSENCRYPT=false
FQDN=""
fi
Expand All @@ -200,7 +200,7 @@ main() {
echo -n "* Prosseguir com a instalação? (s/N): "

read -r CONFIRM
if [[ "$CONFIRM" =~ [Ss] ]]; then
if [[ "$CONFIRM" =~ [SsYy] ]]; then
run_installer "wings"
else
error "Instalação abortada."
Expand Down

0 comments on commit d2780ec

Please sign in to comment.