From f5a6c40379a80502a58b0179652d6d52bdb2a853 Mon Sep 17 00:00:00 2001 From: Esteban Mackay Q <49044505+hp3icc@users.noreply.github.com> Date: Mon, 1 Aug 2022 21:02:28 -0500 Subject: [PATCH] Update update.sh --- update.sh | 101 ++++-------------------------------------------------- 1 file changed, 6 insertions(+), 95 deletions(-) diff --git a/update.sh b/update.sh index 53758bd..fb9d7c0 100644 --- a/update.sh +++ b/update.sh @@ -137,102 +137,13 @@ exit 0 EOF # -sudo cat > /bin/menu-fdmr <<- "EOF" -#!/bin/bash -while : ; do -choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu FreeDMR" --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion:" 23 56 13 \ -1 " Editar FreeDMR Server " \ -2 " Editar Interlink " \ -3 " Editar FDMR-Monitor " \ -4 " Editar Puerto HTTP " \ -5 " Parrot on " \ -6 " Parrot off " \ -7 " start FreeDMR Server " \ -8 " stop FreeDMR Server " \ -9 " FDMR-Monitor On&Restart " \ -10 " FDMR-Monitor off " \ -11 " D-APRS Igate " \ -12 " Menu Principal " 3>&1 1>&2 2>&3) -exitstatus=$? -#on recupere ce choix -#exitstatus=$? -if [ $exitstatus = 0 ]; then - echo "Your chosen option:" $choix -else - echo "You chose cancel."; break; -fi -# case : action en fonction du choix -case $choix in -1) -sudo nano /opt/FreeDMR/config/FreeDMR.cfg ;; -2) -sudo nano /opt/FreeDMR/config/rules.py ;; -3) -sudo nano /opt/FDMR-Monitor/fdmr-mon.cfg ;; -4) -sudo nano /etc/apache2/ports.conf && systemctl restart apache2.service ;; -5) -sudo systemctl stop fdmrparrot.service && sudo systemctl start fdmrparrot.service && sudo systemctl enable fdmrparrot.service ;; -6) -sudo systemctl stop fdmrparrot.service && sudo systemctl disable fdmrparrot.service ;; -7) -sudo systemctl stop proxy.service && sudo systemctl start proxy.service && sudo systemctl enable proxy.service && sudo systemctl stop freedmr.service && sudo systemctl start freedmr.service && sudo systemctl enable freedmr.service ;; -8) -sudo systemctl stop freedmr.service && sudo systemctl disable freedmr.service && sudo systemctl stop proxy.service && sudo systemctl disable proxy.service && rm /var/log/FreeDMR/* ;; -9) -echo 123> /opt/FDMR-Monitor/data/123.json && sudo systemctl stop fdmr_mon.service && sudo rm /opt/FDMR-Monitor/data/* && sudo rm /opt/FDMR-Monitor/sysinfo/*.rrd && sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh && cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' add && cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' add && sudo systemctl enable fdmr_mon.service && sudo systemctl restart apache2.service && sudo systemctl enable apache2.service && sudo systemctl start fdmr_mon.service && cronedit.sh '0 3 * * *' 'rm /opt/FDMR-Monitor/data/*' add ;; -10) -sudo systemctl stop fdmr_mon.service && sudo systemctl disable fdmr_mon.service && sudo systemctl stop apache2.service && sudo systemctl disable apache2.service && cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' remove && cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' remove && cronedit.sh '0 3 * * *' 'rm /opt/FDMR-Monitor/data/*' remove ;; -11) -menu-igate ;; -12) -break; -esac -done -exit 0 +sudo cat > /opt/emq-ver <<- "EOF" +EMQ-VER: 20.2 EOF -#### -##########menu-dvs -cat > /bin/menu-dvs <<- "EOF" -#!/bin/bash -while : ; do -choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : Debe encender Dvswitch antes de editar para utilizar." 20 60 11 \ -1 " Encender Dvswitch " \ -2 " Apagar Dvswitch " \ -3 " Editar Dvswitch Server " \ -4 " Cambiar Puerto http de Dashboard " \ -5 " Dashboard on " \ -6 " Dashboard off " \ -7 " Menu Principal " 3>&1 1>&2 2>&3) -exitstatus=$? -#on recupere ce choix -#exitstatus=$? -if [ $exitstatus = 0 ]; then - echo "Your chosen option:" $choix -else - echo "You chose cancel."; break; -fi -# case : action en fonction du choix -case $choix in -1) -sudo systemctl restart quantar_bridge.service && sudo systemctl enable quantar_bridge.service && sudo systemctl restart p25parrot.service && sudo systemctl enable p25parrot.service && sudo systemctl restart ysfparrot.service && sudo systemctl enable ysfparrot.service && sudo systemctl restart nxdnparrot.service && sudo systemctl enable nxdnparrot.service && sudo systemctl restart ircddbgatewayd.service && sudo systemctl enable ircddbgatewayd.service && sudo systemctl restart analog_bridge.service && sudo systemctl restart mmdvm_bridge.service && sudo systemctl restart nxdngateway.service && sudo systemctl restart p25gateway.service && sudo systemctl restart ysfgateway.service && sudo systemctl enable analog_bridge.service && sudo systemctl enable mmdvm_bridge.service && sudo systemctl enable nxdngateway.service && sudo systemctl enable p25gateway.service && sudo systemctl enable ysfgateway.service ;; -2) -sudo systemctl stop quantar_bridge.service && sudo systemctl disable quantar_bridge.service && sudo systemctl stop p25parrot.service && sudo systemctl disable p25parrot.service && sudo systemctl stop ysfparrot.service && sudo systemctl disable ysfparrot.service && sudo systemctl stop nxdnparrot.service && sudo systemctl disable nxdnparrot.service && sudo systemctl stop ircddbgatewayd.service && sudo systemctl disable ircddbgatewayd.service && sudo systemctl stop analog_bridge.service && sudo systemctl stop mmdvm_bridge.service && sudo systemctl stop nxdngateway.service && sudo systemctl stop p25gateway.service && sudo systemctl stop ysfgateway.service && sudo systemctl disable analog_bridge.service && sudo systemctl disable mmdvm_bridge.service && sudo systemctl disable nxdngateway.service && sudo systemctl disable p25gateway.service && sudo systemctl disable ysfgateway.service && rm /var/log/mmdvm/*;; -3) -sudo /usr/local/dvs/dvs ;; -4) -nano /lib/systemd/system/http.server-dvs.service && sudo systemctl daemon-reload ;; -5) -sudo systemctl restart http.server-dvs.service && sudo systemctl enable http.server-dvs.service ;; -6) -sudo systemctl stop http.server-dvs.service && sudo systemctl disable http.server-dvs.service ;; -7) -break; -esac -done -exit 0 -EOF -# +######### +sh -c "$(curl -fsSL https://raw.githubusercontent.com/hp3icc/emq-TE1ws/main/menu.sh)" +variable22=$(grep "EMQ-VER:" /opt/emq-ver | tail -c 5) +sudo sed -i "s/R00ab/$variable22/g" /bin/menu #####