diff --git a/install.sh b/install.sh index dc2d8cd..7acf893 100644 --- a/install.sh +++ b/install.sh @@ -69,7 +69,46 @@ then variable=0000 fi -################################### +SERVICIOS=("adn-server.service" "freedmr.service" "proxy.service" "adn-parrot.service" "fdmrparrot.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 [ -f "/lib/systemd/system/fdmrparrot.service" ]; +then + rm /lib/systemd/system/fdmrparrot.service +fi +if [ -f "/lib/systemd/system/freedmr.service" ]; +then + rm /lib/systemd/system/freedmr.service +fi +if [ -f "/opt/FreeDMR/config/FreeDMR.cfg" ]; +then + mv /opt/FreeDMR/config/FreeDMR.cfg /opt/Old_Config-FreeDMR.cfg +fi +if [ -d "/opt/FreeDMR" ]; +then + rm -r /opt/FreeDMR/ +fi +########################################################## if [ -d "/var/log/ADN" ] then