From 4425356d132c64847fd3fe6593bdaaceb42cdd55 Mon Sep 17 00:00:00 2001 From: laWiskaPY <82781997+weskerty@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:18:31 -0400 Subject: [PATCH] Update update.sh --- web/Guias/Utilidades/update.sh | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/web/Guias/Utilidades/update.sh b/web/Guias/Utilidades/update.sh index 0780fc878..d2db4a18c 100644 --- a/web/Guias/Utilidades/update.sh +++ b/web/Guias/Utilidades/update.sh @@ -1,5 +1,29 @@ #!/bin/bash -apt update -y && apt upgrade -y -cd $HOME/mystic/ || echo Falla. Mystic no Existe. -npm install @whiskeysockets/baileys@latest --force || echo "#########Error al Actualizar Baileys. Continuando Igualmente" -npm start . + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +echo -e "${YELLOW}######### Actualizando Sistema...${NC}" +apt-get update -y && apt-get upgrade -y + +cd "$HOME/mystic/" || { echo -e "${RED}######### Error. No existe Mystic.${NC}"; exit 1; } + +echo -e "${YELLOW}######### Comprobando Actualizacion...${NC}" +git_output=$(git pull https://github.com/BrunoSobrino/TheMystic-Bot-MD.git) + +if [[ "$git_output" == *"Already up to date."* ]]; then + echo -e "${GREEN}######### Ya Actualizado.${NC}" +else + echo -e "${YELLOW}######### Actualizando${NC}" + + npm install || { echo -e "${RED}######### Error en NPM INSTALL.${NC}"; } + + echo -e "${GREEN}######### Actualizacion Completa.${NC}" +fi + +cd "$HOME" || { echo -e "${RED}######### Error en cd Home.${NC}"; exit 1; } + +echo -e "${YELLOW}######### Ejecutando Mystic...${NC}" +nice -n -10 ./mystic.sh || { echo -e "${RED}######### Error al ejecutar mystic.sh.${NC}"; exit 1; }