From 945f297a53641ca556803e9145016758b8afdc60 Mon Sep 17 00:00:00 2001 From: Esteban Mackay Q <49044505+hp3icc@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:23:56 -0500 Subject: [PATCH] update --- install/dvswitch.sh | 2 ++ menu/menu-dvs | 31 ++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/install/dvswitch.sh b/install/dvswitch.sh index c9d7dd1..6818abb 100644 --- a/install/dvswitch.sh +++ b/install/dvswitch.sh @@ -131,6 +131,8 @@ sed -i 's/www\/html/www\/dvs/g' /var/lib/dpkg/info/dvswitch* sed -i "s/Language=en_US/Language=es_ES/g" /opt/NXDNGateway/NXDNGateway.ini sed -i "s/Language=en_US/Language=es_ES/g" /opt/P25Gateway/P25Gateway.ini # +cp /var/www/dvs/index.php /var/www/dvs/index.txt +# sudo cat > /opt/MMDVM_Bridge/MMDVM_Bridge.ini <<- "EOF" [General] Callsign=N0CALL diff --git a/menu/menu-dvs b/menu/menu-dvs index 88183c0..194a52b 100644 --- a/menu/menu-dvs +++ b/menu/menu-dvs @@ -22,7 +22,8 @@ choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu DVSwitch" --menu "Nota : 4 " Cambiar Puerto http de Dashboard " \ 5 " Dashboard on " \ 6 " Dashboard off " \ -7 " Menu Principal " 3>&1 1>&2 2>&3) +7 " Remove Buttons Dashboard " \ +8 " Menu Principal " 3>&1 1>&2 2>&3) exitstatus=$? #on recupere ce choix #exitstatus=$? @@ -119,6 +120,7 @@ else fi fi ;; 5) +cp /var/www/dvs/index.txt /var/www/dvs/index.php if sudo systemctl status http.server-dvs.service |grep "service; enabled;" >/dev/null 2>&1 then sudo systemctl disable http.server-dvs.service @@ -146,6 +148,33 @@ fi ;; 6) sudo systemctl stop http.server-dvs.service && sudo systemctl disable http.server-dvs.service ;; 7) +cp /var/www/dvs/index.txt /var/www/dvs/index.php && +sed -i '111,203{/^$/!s/^/\/\/ /}' /var/www/dvs/index.php +if sudo systemctl status http.server-dvs.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl disable http.server-dvs.service +fi +if sudo systemctl status http.server-dvs.service |grep active >/dev/null 2>&1 +then + sudo systemctl stop http.server-dvs.service +fi +variable80=$(grep "Web-Dashboar-Port:" /opt/wdp3 | grep -Eo '[A.0-9]{1,9}') +if [ -z "$variable80" ] +then variable80=80 + +fi +sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable80 -t \/var\/www\/dvs\//g" /lib/systemd/system/http.server-dvs.service && +systemctl daemon-reload && +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 http.server-dvs.service |grep "service; enabled;" >/dev/null 2>&1 + then + sudo systemctl enable http.server-dvs.service + fi + sudo systemctl start http.server-dvs.service +fi ;; +8) break; esac done