From c94eae4639ab01eff137c59142733fe052592c7a Mon Sep 17 00:00:00 2001 From: RaspbianProyect by HP3ICC Date: Sun, 12 Feb 2023 17:51:40 +0000 Subject: [PATCH] Update update.sh --- update.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/update.sh b/update.sh index ac5f06f..d37a873 100644 --- a/update.sh +++ b/update.sh @@ -1,5 +1,75 @@ #!/bin/bash cd / +# +sudo cat > /bin/menu-fdmr <<- "EOF" +#!/bin/bash +while : ; do +choix=$(whiptail --title "Raspbian Proyect HP3ICC FDMR+" --menu "move up or down with the keyboard arrows and select your option by pressing enter:" 23 56 13 \ +1 " Edit FreeDMR Server " \ +2 " Edit Interlink " \ +3 " Edit FDMR-Monitor " \ +4 " Edit Port HTTP " \ +5 " Start-Restart FreeDMR Server " \ +6 " Start-Restart FDMR-Monitor " \ +7 " Stop FreeDMR SERVER " \ +8 " Stop FDMR-Monitor " \ +9 " Menu update " 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 /lib/systemd/system/http.server-fdmr.service && systemctl daemon-reload && systemctl restart http.server-fdmr.service ;; +5) +sudo systemctl stop fdmrparrot.service +sudo systemctl start fdmrparrot.service +sudo systemctl enable fdmrparrot.service +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 ;; +6) +sudo systemctl stop fdmr_mon.service +sudo systemctl start fdmr_mon.service +sudo systemctl enable fdmr_mon.service +sudo systemctl stop http.server-fdmr.service +sudo systemctl start http.server-fdmr.service +sudo systemctl enable http.server-fdmr.service;; +7) +sudo systemctl stop fdmrparrot.service +sudo systemctl disable fdmrparrot.service +sudo systemctl stop proxy.service +sudo systemctl disable proxy.service +sudo systemctl stop freedmr.service +sudo systemctl disable freedmr.service ;; +8) +sudo systemctl stop fdmr_mon.service +sudo systemctl disable fdmr_mon.service +sudo systemctl stop http.server-fdmr.service +sudo systemctl disable http.server-fdmr.service;; +9) +sh -c "$(curl -fsSL https://gitlab.com/hp3icc/fdmr/-/raw/main/update.sh)"; +esac +done +exit 0 +EOF +### +chmod +x /bin/menu-fdmr + sudo cat > /bin/menu-update <<- "EOF" #!/bin/bash while : ; do