Update update.sh

merge-requests/1/head
Script Proyect by HP3ICC 2 years ago
parent 984e6cd530
commit dcf2582ba0

@ -5,29 +5,6 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
(crontab -l | grep -v "sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1") | crontab -
SERVICIOS=("http.server-fdmr.service" "http.server-fdmr2.service")
for servicio in "${SERVICIOS[@]}"; do
# Verificar si el servicio existe
if systemctl list-unit-files --type=service | grep -q "^$servicio "; then
echo "El servicio $servicio existe."
# Verificar si el servicio está activo
if systemctl is-active --quiet $servicio; then
echo "El servicio $servicio está activo. Deteniendo..."
sudo systemctl stop $servicio
else
echo "El servicio $servicio no está activo."
fi
# Deshabilitar el servicio
echo "Deshabilitando el servicio $servicio..."
sudo systemctl disable $servicio
else
echo "El servicio $servicio no existe."
fi
done
##############
cd /
##################
@ -100,19 +77,7 @@ EOF
fi
sudo chmod +x /opt/extra-*
cd /
#
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-fdmr)"
###
chmod +x /bin/menu*
####
if [ -d "/opt/D-APRS" ]
then
echo "found file"
else
bash -c "$(curl -fsSLk https://raw.githubusercontent.com/hp3icc/D-APRS/main/emq-daprs.sh)"
fi
####
########
sudo cat > /bin/menu-update <<- "EOF"
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
@ -498,6 +463,12 @@ then
fi
######
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-fdmr)"
if [ -d "/opt/D-APRS" ]
then
echo "found file"
else
bash -c "$(curl -fsSLk https://raw.githubusercontent.com/hp3icc/D-APRS/main/emq-daprs.sh)"
fi
EOFD1
sudo chmod +x /opt/fdmr-update.sh
@ -816,7 +787,6 @@ then
fi
#########################
#lamp
systemctl restart mariadb
systemctl enable mariadb
#sudo mysql_secure_installation --host=localhost --port=3306
@ -858,7 +828,8 @@ cd /opt/FDMR-Monitor2
sudo git checkout Self_Service
#sudo pip install -U -r requirements.txt
chmod 777 /opt/FDMR-Monitor2/data
chmod -R 777 /opt/FDMR-Monitor2/*
chmod -R +x /opt/FDMR-Monitor2/*
sudo chmod 644 /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg
sed -i "s|SUBSCRIBER_URL.*|SUBSCRIBER_URL = https://adn.systems/files/subscriber_ids.json|g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg
@ -1027,7 +998,18 @@ if [ -d "/opt/ADN-DMR-Peer-Server/" ]
then
menu-update
else
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/fdmr/-/raw/main/install.sh)"
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/fdmr/-/raw/main/install.sh)" &&
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-fdmr)"
#!/bin/bash
# Mensaje en español e inglés, separados por una línea en blanco
mensaje="El software de su servidor ha sido actualizado a la versión ADN-DMR-Peer-Server. Por favor, salga por completo del menú e ingrese a: menu-adn
The software on your server has been updated to version ADN-DMR-Peer-Server. Please exit the menu completely and enter: menu-adn"
# Usar whiptail para mostrar el mensaje
whiptail --title "Actualización de Software / Software Update" --msgbox "$mensaje" 15 60
fi

Loading…
Cancel
Save

Powered by TurnKey Linux.