|
|
|
@ -284,7 +284,7 @@ then variable=0000
|
|
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
SERVICIOS=("adn-server.service" "freedmr.service" "proxy.service" "adn-parrot.service" "fdmrparrot.service")
|
|
|
|
SERVICIOS=("adn-server.service" "freedmr.service" "proxy.service" "adn-parrot.service" "fdmrparrot.service" "adn_server.service" "adn_proxy.service" "adn_parrot.service")
|
|
|
|
|
|
|
|
|
|
|
|
for servicio in "${SERVICIOS[@]}"; do
|
|
|
|
for servicio in "${SERVICIOS[@]}"; do
|
|
|
|
# Verificar si el servicio existe
|
|
|
|
# Verificar si el servicio existe
|
|
|
|
@ -493,7 +493,29 @@ variable4=$(grep "COLOR_1 =" /opt/FDMR-Monitor/fdmr-mon.cfg)
|
|
|
|
variable5=$(grep "COLOR_2 =" /opt/FDMR-Monitor/fdmr-mon.cfg)
|
|
|
|
variable5=$(grep "COLOR_2 =" /opt/FDMR-Monitor/fdmr-mon.cfg)
|
|
|
|
|
|
|
|
|
|
|
|
#####################################
|
|
|
|
#####################################
|
|
|
|
|
|
|
|
SERVICIOS=("adn_dashboard.service" "apache2.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
|
|
|
|
sudo systemctl stop fdmr_mon2.service
|
|
|
|
sudo systemctl stop fdmr_mon2.service
|
|
|
|
sudo systemctl stop fdmr_mon.service
|
|
|
|
sudo systemctl stop fdmr_mon.service
|
|
|
|
|
|
|
|
|
|
|
|
@ -746,8 +768,12 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f "/etc/nginx/sites-enabled/freedmr" ]; then
|
|
|
|
if [ -f "/etc/nginx/sites-enabled/freedmr" ]; then
|
|
|
|
mv /etc/nginx/sites-enabled/freedmr /etc/nginx/sites-enabled/adn
|
|
|
|
mv /etc/nginx/sites-enabled/freedmr /etc/nginx/sites-enabled/adn
|
|
|
|
sudo systemctl restart nginx
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! systemctl status nginx.service |grep "service; enabled;" >/dev/null 2>&1
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
systemctl enable nginx.service
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo systemctl restart nginx
|
|
|
|
|
|
|
|
|
|
|
|
EOFB1
|
|
|
|
EOFB1
|
|
|
|
sudo chmod +x /opt/monitor-update.sh
|
|
|
|
sudo chmod +x /opt/monitor-update.sh
|
|
|
|
@ -763,7 +789,29 @@ if ! grep -q "Web-Dashboar-name: adn" "/opt/wdp" > /dev/null 2>&1; then
|
|
|
|
sed -i "s|Web-Dashboar-name:.*|Web-Dashboar-name: adn|g" /opt/wdp
|
|
|
|
sed -i "s|Web-Dashboar-name:.*|Web-Dashboar-name: adn|g" /opt/wdp
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
##############
|
|
|
|
##############
|
|
|
|
|
|
|
|
SERVICIOS=("adn_dashboard.service" "apache2.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
|
|
|
|
sudo systemctl stop fdmr_mon.service
|
|
|
|
sudo systemctl stop fdmr_mon.service
|
|
|
|
sudo systemctl stop fdmr_mon2.service
|
|
|
|
sudo systemctl stop fdmr_mon2.service
|
|
|
|
|
|
|
|
|
|
|
|
@ -968,8 +1016,12 @@ sh /opt/extra-3.sh
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f "/etc/nginx/sites-enabled/freedmr" ]; then
|
|
|
|
if [ -f "/etc/nginx/sites-enabled/freedmr" ]; then
|
|
|
|
mv /etc/nginx/sites-enabled/freedmr /etc/nginx/sites-enabled/adn
|
|
|
|
mv /etc/nginx/sites-enabled/freedmr /etc/nginx/sites-enabled/adn
|
|
|
|
sudo systemctl restart nginx
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! systemctl status nginx.service |grep "service; enabled;" >/dev/null 2>&1
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
systemctl enable nginx.service
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
sudo systemctl restart nginx
|
|
|
|
|
|
|
|
|
|
|
|
EOFB2
|
|
|
|
EOFB2
|
|
|
|
sudo chmod +x /opt/monitor-update2.sh
|
|
|
|
sudo chmod +x /opt/monitor-update2.sh
|
|
|
|
|