Update emq-daprs.sh

This commit is contained in:
Esteban Mackay Q. 2024-06-02 02:23:46 -05:00
parent 4bb330afb9
commit bf74055dc4
1 changed files with 3 additions and 47 deletions

View File

@ -31,9 +31,7 @@ choix=$(whiptail --title "D-APRS KF7EEL / Raspbian Proyect HP3ICC Esteban Mackay
1 " Editar igate" \ 1 " Editar igate" \
2 " Iniciar Igate " \ 2 " Iniciar Igate " \
3 " Detener Igate " \ 3 " Detener Igate " \
4 " Dashboard on " \ 4 " Salir del menu " 3>&1 1>&2 2>&3)
5 " Dashboard off " \
6 " Salir del menu " 3>&1 1>&2 2>&3)
exitstatus=$? exitstatus=$?
#on recupere ce choix #on recupere ce choix
@ -63,28 +61,6 @@ sudo systemctl stop daprs.service && sudo systemctl start daprs.service && sudo
3) 3)
sudo systemctl stop daprs.service && sudo systemctl disable daprs.service ;; sudo systemctl stop daprs.service && sudo systemctl disable daprs.service ;;
4) 4)
if sudo systemctl status daprs-board.service |grep "service; enabled;" >/dev/null 2>&1
then
sudo systemctl disable daprs-board.service
fi
if sudo systemctl status daprs-board.service |grep active >/dev/null 2>&1
then
sudo systemctl stop daprs-board.service
fi
variable80=$(grep "DASH_PORT:" /opt/D-APRS/gps_data.cfg | grep -Eo '[A.0-9]{1,9}')
if sudo netstat -tuln | grep -q "0.0.0.0:$variable80 "; then
whiptail --title "Check Port" --msgbox "El puerto $variable80 esta ocupado , The port $variable80 is busy" 0 50
else
if ! sudo systemctl status daprs-board.service |grep "service; enabled;" >/dev/null 2>&1
then
sudo systemctl enable daprs-board.service
fi
sudo systemctl start daprs-board.service
fi ;;
5)
sudo systemctl stop daprs-board.service && sudo systemctl disable daprs-board.service ;;
6)
break; break;
esac esac
done done
@ -109,35 +85,15 @@ WantedBy=multi-user.target
EOF EOF
# ##
sudo cat > /lib/systemd/system/daprs-board.service <<- "EOF"
[Unit]
Description=Dashboard D-APRS
After=network-online.target syslog.target
Wants=network-online.target
[Service]
StandardOutput=null
WorkingDirectory=/opt/D-APRS/dashboard
RestartSec=3
ExecStart=/usr/bin/python3 /opt/D-APRS/dashboard/dashboard.py -c /opt/D-APRS/gps_data.cfg
Restart=on-abort
[Install]
WantedBy=multi-user.target
EOF
#
sudo chmod -R 777 /opt/D-APRS/* sudo chmod -R 777 /opt/D-APRS/*
sudo chmod -R +x /opt/D-APRS/* sudo chmod -R +x /opt/D-APRS/*
ln -sf /bin/menu-igate /bin/MENU-IGATE ln -sf /bin/menu-igate /bin/MENU-IGATE
sudo chmod +x /bin/menu-igate sudo chmod +x /bin/menu-igate
sudo chmod +x /bin/MENU-IGATE sudo chmod +x /bin/MENU-IGATE
sudo chmod 755 /lib/systemd/system/daprs-board.service
sudo chmod 755 /lib/systemd/system/daprs.service sudo chmod 755 /lib/systemd/system/daprs.service
sudo systemctl daemon-reload sudo systemctl daemon-reload
/usr/bin/python3 -m pip install --upgrade -r requirements.txt #/usr/bin/python3 -m pip install --upgrade -r requirements.txt
# Registra el final en /opt/curl.txt # Registra el final en /opt/curl.txt
echo "Finalizado: $SCRIPT_NAME" >> /opt/curl.txt echo "Finalizado: $SCRIPT_NAME" >> /opt/curl.txt