####menu-dw-analogo cat > /bin/menu-dw <<- "EOF" #!/bin/bash while : ; do choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu Direwolf" --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion" 20 55 11 \ 1 " Edit Direwolf Analogo " \ 2 " Edit Direwolf SDR-RTL " \ 3 " Edit Frecuency SDR-RTL " \ 4 " Edit Direwolf Tracker " \ 5 " Edit Dashboard " \ 6 " Edit port http Dashbord " \ 7 " Start Direwolf SDR-RTL" \ 8 " Start Direwolf Tracker" \ 9 " Start Direwolf Analogo" \ 10 " Start Direwolf Analogo + Dashboard" \ 11 " Stop All Direwolf" \ 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/direwolf/dw.conf;; 2) sudo nano /opt/direwolf/sdr.conf;; 3) sudo nano /opt/direwolf/rtl.sh 4) sudo nano /opt/direwolf/gpsd.conf;; 5) sudo nano /opt/direwolf_webstat/config.php;; 6) sudo nano /lib/systemd/system/http.server-dw.service && sudo systemctl daemon-reload && if systemctl status http.server-dw.service |grep running >/dev/null 2>&1 then sudo systemctl restart http.server-dw.service fi ;; 7) sudo systemctl stop direwolf.service sudo systemctl stop http.server-dw.service sudo systemctl stop gpsd.service if systemctl status gpsd.service | grep enable >/dev/null 2>&1 then sudo systemctl disable gpsd.service fi if systemctl status http.server-dw.service | grep enable >/dev/null 2>&1 then sudo systemctl disable http.server-dw.service fi if [ "$(cat /proc/cpuinfo | grep 'Zero')" != "" ]; then sudo cp /opt/direwolf/direwolf1 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf else sudo cp /opt/direwolf/direwolf2 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf fi sudo sed -i "s/ExecStart=.*/ExecStart=\/bin\/sh \/opt\/direwolf\/rtl.sh/" /lib/systemd/system/direwolf.service sudo systemctl daemon-reload sudo systemctl start direwolf.service sudo systemctl enable direwolf.service ;; 8) sudo systemctl stop direwolf.service sudo systemctl stop http.server-dw.service sudo systemctl stop gpsd.service if systemctl status http.server-dw.service | grep enable >/dev/null 2>&1 then sudo systemctl disable http.server-dw.service fi if [ "$(cat /proc/cpuinfo | grep 'Zero')" != "" ]; then sudo cp /opt/direwolf/direwolf1 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf else sudo cp /opt/direwolf/direwolf2 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf fi sudo sed -i "s/ExecStart=.*/ExecStart=\/usr\/local\/bin\/direwolf -c \/opt\/direwolf\/gpsd.conf/" /lib/systemd/system/direwolf.service sudo systemctl daemon-reload sudo systemctl start gpsd.service sudo systemctl enable gpsd.service sudo systemctl start direwolf.service sudo systemctl enable direwolf.service ;; 9) sudo systemctl stop direwolf.service sudo systemctl stop http.server-dw.service sudo systemctl stop gpsd.service if systemctl status gpsd.service | grep enable >/dev/null 2>&1 then sudo systemctl disable gpsd.service fi if systemctl status http.server-dw.service | grep enable >/dev/null 2>&1 then sudo systemctl disable http.server-dw.service fi if [ "$(cat /proc/cpuinfo | grep 'Zero')" != "" ]; then sudo cp /opt/direwolf/direwolf1 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf else sudo cp /opt/direwolf/direwolf2 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf fi sudo sed -i "s/ExecStart=.*/ExecStart=sudo direwolf -c \/opt\/direwolf\/dw.conf/" /lib/systemd/system/direwolf.service sudo systemctl daemon-reload sudo systemctl start direwolf.service sudo systemctl enable direwolf.service ;; 10) sudo systemctl stop direwolf.service sudo systemctl stop http.server-dw.service sudo systemctl stop gpsd.service if systemctl status gpsd.service | grep enable >/dev/null 2>&1 then sudo systemctl disable gpsd.service fi if [ "$(cat /proc/cpuinfo | grep 'Zero')" != "" ]; then sudo cp /opt/direwolf/direwolf1 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf else sudo cp /opt/direwolf/direwolf2 /usr/local/bin/direwolf sudo chmod +x /usr/local/bin/direwolf fi sudo sed -i "s/ExecStart=.*/ExecStart=\/usr\/local\/bin\/direwolf -l \/var\/log\/direwolf -c \/opt\/direwolf\/dw.conf/" /lib/systemd/system/direwolf.service sudo systemctl daemon-reload sudo systemctl start direwolf.service sudo systemctl start http.server-dw.service sudo systemctl enable http.server-dw.service sudo systemctl enable direwolf.service ;; 11) if systemctl status http.server-dw.service | grep enable >/dev/null 2>&1 then sudo systemctl disable http.server-dw.service fi sudo systemctl stop http.server-dw.service if systemctl status direwolf.service | grep enable >/dev/null 2>&1 then sudo systemctl disable direwolf.service fi sudo systemctl stop direwolf.service if systemctl status gpsd.service | grep enable >/dev/null 2>&1 then sudo systemctl disable gpsd.service fi sudo systemctl stop gpsd.service ;; 12) break; esac done exit 0 EOF ## chmod +x /bin/menu-dw-analogo