From 87e68dd00ce739d61d8191cb8ec7627710236521 Mon Sep 17 00:00:00 2001 From: Esteban Mackay Q Date: Fri, 20 Oct 2023 09:01:35 -0500 Subject: [PATCH] update add mmdvmcal --- install.sh | 2 +- install/mmdvm.sh | 13 +++++- menu/menu-mmdvm | 110 +++++++++++++++++++++++++++++++++-------------- 3 files changed, 90 insertions(+), 35 deletions(-) diff --git a/install.sh b/install.sh index 53cde38..395a6a8 100644 --- a/install.sh +++ b/install.sh @@ -211,7 +211,7 @@ EOF ### ############################## cat > /opt/emq-ver <<- "EOF" -EMQ-VER: 23.10.19 +EMQ-VER: 23.10.20 EOF ############################## bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu)" diff --git a/install/mmdvm.sh b/install/mmdvm.sh index 7d3c312..08ea752 100644 --- a/install/mmdvm.sh +++ b/install/mmdvm.sh @@ -618,7 +618,18 @@ WantedBy=multi-user.target EOF -# +################# +# MMDVMCAL +if [ -d "/opt/MMDVMCal" ] +then + rm -r /opt/MMDVMCal +fi +cd /opt +git clone https://github.com/g4klx/MMDVMCal.git +cd /opt/MMDVMCal/ +sudo make clean +sudo make +sudo make install ##################################################################################################################### systemctl daemon-reload diff --git a/menu/menu-mmdvm b/menu/menu-mmdvm index 7c45758..5ef952d 100644 --- a/menu/menu-mmdvm +++ b/menu/menu-mmdvm @@ -20,15 +20,16 @@ choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu MMDVMHost" --menu "Suba o 2 " Editar DMRGateway " \ 3 " Editar YSFGateway " \ 4 " Editar YSF2DMR " \ -5 " Start&Restart service MMDVM " \ -6 " Stop service MMDVM " \ -7 " Dashboard ON " \ -8 " Dashboard Off " \ -9 " Editar Puerto http " \ -10 " Editar HTML " \ -11 " Editar Dashboard " \ -12 " Update Dashboard TG Name " \ -13 " Menu Principal " 3>&1 1>&2 2>&3) +5 " MMDVMCal " \ +6 " Start&Restart service MMDVM " \ +7 " Stop service MMDVM " \ +8 " Dashboard ON " \ +9 " Dashboard Off " \ +10 " Editar Puerto http " \ +11 " Editar HTML " \ +12 " Editar Dashboard " \ +13 " Update Dashboard TG Name " \ +14 " Menu Principal " 3>&1 1>&2 2>&3) exitstatus=$? #on recupere ce choix #exitstatus=$? @@ -40,14 +41,68 @@ fi # case : action en fonction du choix case $choix in 1) -sudo nano /opt/MMDVMHost/MMDVM.ini;; +sudo nano /opt/MMDVMHost/MMDVM.ini +if sudo systemctl status mmdvmh.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl stop mmdvmh.service + sudo systemctl start mmdvmh.service +fi ;; 2) -sudo nano /opt/DMRGateway/DMRGateway.ini;; +sudo nano /opt/DMRGateway/DMRGateway.ini +if sudo systemctl status dmrgw.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl stop dmrgw.service + sudo systemctl start dmrgw.service +fi ;; 3) -sudo nano /opt/YSFGateway2/YSFGateway.ini;; +sudo nano /opt/YSFGateway2/YSFGateway.ini +if sudo systemctl status ysfgw.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl stop ysfgw.service + sudo systemctl start ysfgw.service +fi ;; 4) -sudo nano /opt/YSF2DMRGW/YSF2DMR.ini;; +sudo nano /opt/YSF2DMRGW/YSF2DMR.ini +if sudo systemctl status ysf2dmrgw.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl stop ysf2dmrgw.service + sudo systemctl start ysf2dmrgw.service +fi ;; 5) + network=$(whiptail --title "MMDVMCal" --menu "Select an option:" 10 60 2 \ + "1" "Edit MMDVM.ini" \ + "2" "Start MMDVMCal / Iniciar MMDVMCal" 3>&1 1>&2 2>&3) + + if [ $? != 0 ]; then + echo "You chose cancel. Returning to the main menu." + continue + fi + + case "$network" in + "1") + sudo nano /opt/MMDVMHost/MMDVM.ini + if sudo systemctl status mmdvmh.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl stop mmdvmh.service + sudo systemctl start mmdvmh.service + fi ;; + "2") + sudo systemctl stop mmdvmh.service + uartp=$(awk -F= '/\[Modem\]/{f=1} f && /^[^#]*UARTPort=/{print $2; exit}' "/opt/MMDVMHost/MMDVM.ini") + uarts=$(awk -F= '/\[Modem\]/{f=1} f && /^[^#]*UARTSpeed=/{print $2; exit}' "/opt/MMDVMHost/MMDVM.ini") + clear + MMDVMCal $uarts $uartp + read -p "Presione Enter para continuar..." + if sudo systemctl status mmdvmh.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl start mmdvmh.service + fi ;; + *) + echo "Invalid selection" + ;; + esac + ;; +6) sudo systemctl stop mmdvmh.service if cat /opt/MMDVMHost/MMDVM.ini | grep ServiceStart=0 >/dev/null 2>&1 then @@ -89,25 +144,14 @@ then sudo systemctl enable dmrgw.service fi ;; -6) -sudo systemctl stop mmdvmh.service && sudo systemctl disable mmdvmh.service && systemctl stop ysf2dmrgw.service && sudo systemctl stop dmrgw.service ;; 7) -if sudo systemctl status http.server-mmdvmh.service |grep "service; enabled;" >/dev/null 2>&1 - then +sudo systemctl stop mmdvmh.service && sudo systemctl disable mmdvmh.service && systemctl stop ysf2dmrgw.service && sudo systemctl stop dmrgw.service ;; +8) sudo systemctl disable http.server-mmdvmh.service -fi -if sudo systemctl status http.server-mmdvmh.service |grep active >/dev/null 2>&1 -then sudo systemctl stop http.server-mmdvmh.service -fi -if sudo systemctl status logtailer-mmdvmh.service |grep "service; enabled;" >/dev/null 2>&1 - then sudo systemctl disable logtailer-mmdvmh.service -fi -if sudo systemctl status logtailer-mmdvmh.service |grep active >/dev/null 2>&1 -then sudo systemctl stop logtailer-mmdvmh.service -fi + variable80=$(grep "Web-Dashboar-Port:" /opt/wdp5 | grep -Eo '[A.0-9]{1,9}') if [ -z "$variable80" ] then variable80=80 @@ -129,9 +173,9 @@ else sudo systemctl start http.server-mmdvmh.service sudo systemctl start logtailer-mmdvmh.service fi ;; -8) -sudo systemctl stop logtailer-mmdvmh.service && sudo systemctl disable logtailer-mmdvmh.service && sudo systemctl stop http.server-mmdvmh.service && sudo systemctl disable http.server-mmdvmh.service && cronedit.sh '* */24 * * *' 'sh /bin/tg-name.sh' remove ;; 9) +sudo systemctl stop logtailer-mmdvmh.service && sudo systemctl disable logtailer-mmdvmh.service && sudo systemctl stop http.server-mmdvmh.service && sudo systemctl disable http.server-mmdvmh.service && cronedit.sh '* */24 * * *' 'sh /bin/tg-name.sh' remove ;; +10) if sudo systemctl status http.server-mmdvmh.service |grep active >/dev/null 2>&1 then sudo systemctl stop http.server-mmdvmh.service @@ -152,13 +196,13 @@ else sudo systemctl start http.server-mmdvmh.service fi fi ;; -10) -sudo nano /opt/MMDVMHost-Websocketboard/html/index.html ;; 11) -sudo nano /opt/MMDVMHost-Websocketboard/html/js/config.js ;; +sudo nano /opt/MMDVMHost-Websocketboard/html/index.html ;; 12) -bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/tgname.sh)";; +sudo nano /opt/MMDVMHost-Websocketboard/html/js/config.js ;; 13) +bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/tgname.sh)";; +14) break; esac done