Update update-dash-dvs.sh

This commit is contained in:
Esteban Mackay Q 2023-12-15 20:18:54 -05:00
parent bb4e784ea9
commit c8419580b4
1 changed files with 23 additions and 0 deletions

View File

@ -17,6 +17,29 @@ then
rm -r /var/www/dvs
fi
mkdir /var/www/dvs
SERVICIOS=("http.server-dvs.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
if ! grep -q "Web-Dashboar-name" "/opt/wdp3" > /dev/null 2>&1; then
sudo cat > /opt/wdp3 <<- "EOFX"
##########################################