From ea5a62b1dc951abf0b7b401a0eba18125e572ebf Mon Sep 17 00:00:00 2001 From: Tom Early Date: Mon, 28 Sep 2020 14:37:32 -0700 Subject: [PATCH] added APRSGateway --- MMDVM.README | 19 +++- Makefile | 22 ++++- qnadmin | 268 +++++++++++++++++++++++++-------------------------- 3 files changed, 168 insertions(+), 141 deletions(-) diff --git a/MMDVM.README b/MMDVM.README index 7a5684a..37fbce1 100644 --- a/MMDVM.README +++ b/MMDVM.README @@ -42,7 +42,24 @@ In your parent directory of your QnetGateway build... 5) If you are using the YSFGateway cd to that directory and copy the ini file: cp YSFGateway.ini YSFGateway.qn - Edit this new YSFGateway.qn file for your system. + In the [General] section, set your callsign and suffix (either RPT or ND). + In the [Info] section, set your RX & TX frequencies, and any other details + as you like. In the [Log] section, set your log levels as your like, set a + /FULL/PATH/TO/LOGROOTFILE for the log, and define the FileRoot--or disable + logging by setting both DisplayLevel and FileLevel to '0'. in the [Network] + section, set a startup reflector (FCS, YSF or XLX), and set InactivityTimeout + (in minutes) as desired. If the reflector is changed, it will return to the + startup reflector after the inactivity timeout is reached if 'Revert' is set + to '1'. 'Options' allows you to monitor multiple DG-IDs if connected to a YCS + server such as QuadNet's FCS310. You set the TX DG-ID on your radio to which + ever DG-ID you wish to transmit into. This has its benfits and drawbacks. + The to TX DG-ID is a global setting on Yaesu radios, so you cannot save it in + a channel like a DMR talkgroup. You must change the DG-ID in the GM menu each + time. Basically, it is good for monitoring, a little cumbersome for talking. + For [YSFNetwork], set the /FULL/PATH/TO/YSFHosts.txt. And finally for + [FCSNetwork], set the /FULL/PATH/TO/FCSRooms.txt. __NEVER__ connect to a + transcoding reflector network such as QuadNet with more than one mode on the + same MMDVM hotspot/ node/ repeater. 6) Next, your ready to install your software. For that, first move back to the QnetGateway directory andstart the administration script: ./qnadmin diff --git a/Makefile b/Makefile index 4db6a0b..69efef2 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ WWWDIR=/usr/local/www MMPATH=../MMDVMHost DMRPATH=../DMRGateway YSFPATH=../YSFClients/YSFGateway +APRSPATH=../APRSGateway SYSDIR=/lib/systemd/system IRC=ircddb @@ -143,7 +144,6 @@ installdmr : $(DMRPATH)/DMRGateway $(DMRPATH)/DMRGateway$(MODULE).qn systemctl daemon-reload systemctl start dmrgateway$(MODULE).service - installysf : $(YSFPATH)/YSFGateway $(YSFPATH)/YSFGateway$(MODULE).qn ######### YSFGateway ######### /bin/ln -f $(YSFPATH)/YSFGateway $(BINDIR)/YSFGateway$(MODULE) @@ -154,6 +154,16 @@ installysf : $(YSFPATH)/YSFGateway $(YSFPATH)/YSFGateway$(MODULE).qn systemctl daemon-reload systemctl start ysfgateway$(MODULE).service +installaprs : $(APRSPATH)/APRSGateway $(APRSPATH)/APRSGateway.qn + ######### APRSGateway ######### + /bin/cp -f $(APRSPATH)/APRSGateway $(BINDIR) + /bin/ln -f -s $(shell pwd)/$(APRSPATH)/APRSGateway.qn $(CFGDIR) + sed -e "s/XXX/APRSGateway/" -e "s/YYY/APRSGateway/" system/mmdvm.service > $(SYSDIR)/aprsgateway.service + /bin/cp -f system/gateway.timer $(SYSDIR)/aprsgateway.timer + systemctl enable aprsgateway.timer + systemctl daemon-reload + systemctl start aprsgateway.service + installitap : qnitap ######### QnetITAP ######### /bin/ln -f qnitap $(BINDIR)/qnitap$(MODULE) @@ -263,6 +273,16 @@ uninstallysf : /bin/rm -f $(CFGDIR)/YSFGateway$(MODULE).qn sudo systemctl daemon-reload +uninstallaprs : + ######### APRSGateway ########## + systemctl stop aprsgateway.service + systemctl disable aprsgateway.timer + /bin/rm -f $(SYSDIR)/aprsgateway.service + /bin/rm -f $(SYSDIR)/aprsgateway.timer + /bin/rm -f $(BINDIR)/APRSGateway + /bin/rm -f $(CFGDIR)/APRSGateway.qn + sudo systemctl daemon-reload + uninstallmodem : ######### QnetModem ######### systemctl stop qnmodem$(MODULE).service diff --git a/qnadmin b/qnadmin index 084fa2e..1211fbd 100755 --- a/qnadmin +++ b/qnadmin @@ -21,6 +21,20 @@ ControlC () { echo "caught SIGINT" } +# arguments "un" exe count module0 module1 module2 +# 1 2 3 4 5 6 +InstallComponent () { + if [ $3 -eq 1 ]; then + sudo make ${1}install$2 + else + sudo make MODULE=$4 ${1}install$2 + sudo make MODULE=$5 ${1}install$2 + if [ $3 -eq 3 ]; then + sudo make MODULE=$6 ${1}install$2 + fi + fi +} + InstallMMDVMHosts () { if [ $nmmdvm -gt 0 ]; then local n @@ -31,7 +45,7 @@ InstallMMDVMHosts () { fi n=$(getconf _NPROCESSORS_ONLN) echo "Detected $n processors for make" - for dir in ../MMDVMHost ../YSFClients ../DMRGateway; do + for dir in $MMPATH $DMRPATH $YSFPATH $APRSPATH; do if [ -d $dir ]; then pushd $dir make -j$n @@ -40,37 +54,16 @@ InstallMMDVMHosts () { done fi if [ -e ${MMPATH}/MMDVMHost ]; then - if [ $nmmdvm -eq 1 ]; then - sudo make ${1}installmmdvm - else - sudo make MODULE=${ammdvm[0]} ${1}installmmdvm - sudo make MODULE=${ammdvm[1]} ${1}installmmdvm - if [ $nmmdvm -eq 3 ]; then - sudo make MODULE=${advap[2]} ${1}installmmdvm - fi - fi + InstallComponent "$1" mmdvm $nmmdvm ${ammdvm[*]} fi if [ -e ${DMRPATH}/DMRGateway ]; then - if [ $nmmdvm -eq 1 ]; then - sudo make ${1}installdmr - else - sudo make MODULE=${ammdvm[0]} ${1}installdmr - sudo make MODULE=${ammdvm[1]} ${1}installdmr - if [ $nmmdvm -eq 3 ]; then - sudo make MODULE=${advap[2]} ${1}installdmr - fi - fi + InstallComponent "$1" dmr $nmmdvm ${ammdvm[*]} fi if [ -e ${YSFPATH}/YSFGateway ]; then - if [ $nmmdvm -eq 1 ]; then - sudo make ${1}installysf - else - sudo make MODULE=${ammdvm[0]} ${1}installysf - sudo make MODULE=${ammdvm[1]} ${1}installysf - if [ $nmmdvm -eq 3 ]; then - sudo make MODULE=${advap[2]} ${1}installysf - fi - fi + InstallComponent "$1" ysf $nmmdvm ${ammdvm[*]} + fi + if [ -e ${APRSPATH}/APRSGateway ]; then + sudo make ${1}installaprs fi fi } @@ -87,82 +80,44 @@ InstallSystem () { if [ -z ${1} ]; then make qndvap -j$n fi - if [ $ndvap -eq 1 ]; then - sudo make ${1}installdvap - else - sudo make MODULE=${advap[0]} ${1}installdvap - sudo make MODULE=${advap[1]} ${1}installdvap - if [ $ndvap -eq 3 ]; then - sudo make MODULE=${advap[2]} ${1}installdvap - fi - fi + InstallComponent "$1" dvap $ndvap ${advap[*]} fi if [ $ndvrptr -gt 0 ]; then if [ -z ${1} ]; then make qndvrptr -j$n fi - if [ $ndvrptr -eq 1 ]; then - sudo make ${1}installdvrptr - else - sudo make MODULE=${advrptr[0]} ${1}installdvrptr - sudo make MODULE=${advrptr[1]} ${1}installdvrptr - if [ $ndvrptr -eq 3 ]; then - sudo make MODULE=${advrptr[2]} ${1}installdvrptr - fi - fi + InstallComponent "$1" dvrptr $ndvrptr ${advrptr[*]} fi if [ $nitap -gt 0 ]; then if [ -z ${1} ]; then make qnitap -j$n fi - if [ $nitap -eq 1 ]; then - sudo make ${1}installitap - else - sudo make MODULE=${aitap[0]} ${1}installitap - sudo make MODULE=${aitap[1]} ${1}installitap - if [ $nitap -eq 3 ]; then - sudo make MODULE=${aitap[2]} ${1}installitap - fi - fi + InstallComponent "$1" itap $nitap ${aitap[*]} fi if [ $nmmdvm -gt 0 ]; then if [ -z ${1} ]; then make qnrelay -j$n fi - if [ $nmmdvm -eq 1 ]; then - sudo make ${1}installrelay - else - sudo make MODULE=${ammdvm[0]} ${1}installrelay - sudo make MODULE=${ammdvm[1]} ${1}installrelay - if [ $nmmdvm -eq 3 ]; then - sudo make MODULE=${advap[2]} ${1}installrelay - fi - fi + InstallComponent "$1" relay $nmmdvm ${ammdvm[*]} fi if [ $nmodem -gt 0 ]; then if [ -z ${1} ]; then make qnmodem -j$n fi - if [ $nmodem -eq 1 ]; then - sudo make ${1}installmodem - else - sudo make MODULE=${amodem[0]} ${1}installmodem - sudo make MODULE=${amodem[1]} ${1}installmodem - if [ $nmmdvm -eq 3 ]; then - sudo make MODULE=${amodem[2]} ${1}installmodem - fi - fi + InstallComponent "$1" modem $nmodem ${amodem[*]} fi } BaseStatus () { - local LoadGate SubGate LoadLink SubLink LoadDTMF SubDTMF + local LoadGate SubGate LoadLink SubLink LoadDTMF SubDTMF LoadAPRS SubAPRS LoadGate=$( systemctl show -p LoadState --value qngateway ) SubGate=$( systemctl show -p SubState --value qngateway ) LoadLink=$( systemctl show -p LoadState --value qnlink ) SubLink=$( systemctl show -p SubState --value qnlink ) LoadDTMF=$( systemctl show -p LoadState --value qndtmf ) SubDTMF=$( systemctl show -p SubState --value qndtmf ) + LoadAPRS=$( systemctl show -p LoadState --value aprsgateway ) + SubAPRS=$( systemctl show -p SubState --value aprsgateway ) if [[ $LoadGate == 'loaded' ]]; then if [[ $SubGate == 'running' ]]; then GateState='running' @@ -192,7 +147,19 @@ BaseStatus () { else DTMFState='not installed' fi - echo "DTMF is $DTMFState" + if [ -d $APRSPATH ]; then + echo "DTMF is $DTMFState" + if [[ $LoadAPRS == 'loaded' ]]; then + if [[ $SubAPRS == 'running' ]]; then + APRSState='running' + else + APRSState='stopped' + fi + else + APRSState='not installed' + fi + echo "APRSGateway is $APRSState" + fi } ModuleStatus () { @@ -207,8 +174,8 @@ ModuleStatus () { MMDVMState[$1]='EMPTY' DMRProcess[$1]='' DMRState[$1]='EMPTY' - YSFProcess[i]='' - YSFState[$i]='EMPTY' + YSFProcess[$1]='' + YSFState[$1]='EMPTY' if [[ "${ModuleProcess[$1]}" == 'qnmmdvmhost' ]]; then ModuleProcess[$1]='qnrelay' MMDVMProcess[$1]='mmdvm' @@ -224,6 +191,8 @@ ModuleStatus () { ModuleProcess[$1]="${ModuleProcess[$1]}${2}" if [[ "${MMDVMProcess[$1]}" == 'mmdvm' ]]; then MMDVMProcess[$1]="${MMDVMProcess[$1]}${2}" + DMRProcess[$1]="${DMRProcess[$1]}${2}" + YSFProcess[$1]="${YSFProcess[$1]}${2}" fi fi LoadState=$( systemctl show -p LoadState --value ${ModuleProcess[$1]} ) @@ -286,7 +255,7 @@ Header () { if [ ${count} -gt 3 ]; then echo echo "USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND" - ps -aux | grep -e qngateway -e qnlink -e qndtmf -e qndvap -e qnitap -e qnrelay -e qndvrptr -e qnmodem -e MMDVMHost -e YSFGateway -e DMRGateway | grep -v grep + ps -aux | grep -e qngateway -e qnlink -e qndtmf -e qndvap -e qnitap -e qnrelay -e qndvrptr -e qnmodem -e MMDVMHost -e YSFGateway -e DMRGateway -e APRSGateway | grep -v grep fi echo } @@ -310,7 +279,7 @@ LogMenu () { echo " qnlink is not running" fi if [[ $DTMFState == 'running' ]]; then - echo " d : qndtmf Log" + echo " dt : qndtmf Log" else echo " qndtmf is not running" fi @@ -337,67 +306,74 @@ LogMenu () { fi if [[ ${MMDVMState[0]} != 'EMPTY' ]]; then if [[ ${MMDVMState[0]} == 'running' ]]; then - echo " r : ${MMDVMProcess[0]} Log" + echo " ma : ${MMDVMProcess[0]} Log" else echo " ${MMDVMProcess[0]} is not running" fi fi if [[ ${MMDVMState[1]} != 'EMPTY' ]]; then if [[ ${MMDVMState[1]} == 'running' ]]; then - echo " s : ${MMDVMProcess[1]} Log" + echo " mb : ${MMDVMProcess[1]} Log" else echo " ${MMDVMProcess[1]} is not running" fi fi if [[ ${MMDVMState[2]} != 'EMPTY' ]]; then if [[ ${MMDVMState[2]} == 'running' ]]; then - echo " t : ${MDVMProcess[2]} Log" + echo " mc : ${MDVMProcess[2]} Log" else echo " ${MMDVMProcess[2]} is not running" fi fi if [[ ${DMRState[0]} != 'EMPTY' ]]; then if [[ ${DMRState[0]} == 'running' ]]; then - echo " u : ${DMRProcess[0]} Log" + echo " da : ${DMRProcess[0]} Log" else echo " ${DMRProcess[0]} is not running" fi fi if [[ ${DMRState[1]} != 'EMPTY' ]]; then if [[ ${DMRState[1]} == 'running' ]]; then - echo " v : ${DMRProcess[1]} Log" + echo " db : ${DMRProcess[1]} Log" else echo " ${DMRProcess[1]} is not running" fi fi if [[ ${DMRState[2]} != 'EMPTY' ]]; then if [[ ${DMRState[2]} == 'running' ]]; then - echo " w : ${DMRProcess[2]} Log" + echo " dc : ${DMRProcess[2]} Log" else echo " ${DMRProcess[2]} is not running" fi fi if [[ ${YSFState[0]} != 'EMPTY' ]]; then if [[ ${YSFState[0]} == 'running' ]]; then - echo " x : ${YSFProcess[0]} Log" + echo " ya : ${YSFProcess[0]} Log" else echo " ${YSFProcess[0]} is not running" fi fi if [[ ${YSFState[1]} != 'EMPTY' ]]; then if [[ ${YSFState[1]} == 'running' ]]; then - echo " y : ${YSFProcess[1]} Log" + echo " yb : ${YSFProcess[1]} Log" else echo " ${YSFProcess[1]} is not running" fi fi if [[ ${YSFState[2]} != 'EMPTY' ]]; then if [[ ${YSFState[2]} == 'running' ]]; then - echo " z : ${YSFProcess[2]} Log" + echo " yc : ${YSFProcess[2]} Log" else echo " ${Process[2]} is not running" fi fi + if [[ ${APRSState} != 'not installed' ]]; then + if [[ ${APRSState} == 'running' ]]; then + echo " p : APRSGateway Log" + else + echo " APRSGateway is not running" + fi + fi echo echo " q : quit and return to main menu" echo @@ -407,7 +383,7 @@ LogMenu () { sudo journalctl -u qngateway -f elif [[ "$ans" == l* ]] && [[ "$LinkState" == 'running' ]]; then sudo journalctl -u qnlink -f - elif [[ "$ans" == d* ]] && [[ "$DTMFState" == 'running' ]]; then + elif [[ "$ans" == dt* ]] && [[ "$DTMFState" == 'running' ]]; then sudo journalctl -u qndtmf -f elif [[ "$ans" == a* ]] && [[ "${ModuleState[0]}" == 'running' ]]; then sudo journalctl -u ${ModuleProcess[0]} -f @@ -415,24 +391,26 @@ LogMenu () { sudo journalctl -u ${ModuleProcess[1]} -f elif [[ "$ans" == c* ]] && [[ "${ModuleState[2]}" == 'running' ]]; then sudo journalctl -u ${ModuleProcess[2]} -f - elif [[ "$ans" == r* ]] && [[ "${MMDVMState[0]}" == 'running' ]]; then + elif [[ "$ans" == ma* ]] && [[ "${MMDVMState[0]}" == 'running' ]]; then sudo journalctl -u ${MMDVMProcess[0]} -f - elif [[ "$ans" == s* ]] && [[ "${MMDVMState[1]}" == 'running' ]]; then + elif [[ "$ans" == mb* ]] && [[ "${MMDVMState[1]}" == 'running' ]]; then sudo journalctl -u ${MMDVMProcess[1]} -f - elif [[ "$ans" == t* ]] && [[ "${MMDVMState[2]}" == 'running' ]]; then + elif [[ "$ans" == mc* ]] && [[ "${MMDVMState[2]}" == 'running' ]]; then sudo journalctl -u ${MMDVMProcess[2]} -f - elif [[ "$ans" == u* ]] && [[ "${DMRState[0]}" == 'running' ]]; then + elif [[ "$ans" == da* ]] && [[ "${DMRState[0]}" == 'running' ]]; then sudo journalctl -u ${DMRProcess[0]} -f - elif [[ "$ans" == v* ]] && [[ "${DMRState[1]}" == 'running' ]]; then + elif [[ "$ans" == db* ]] && [[ "${DMRState[1]}" == 'running' ]]; then sudo journalctl -u ${DMRProcess[1]} -f - elif [[ "$ans" == w* ]] && [[ "${DMRState[2]}" == 'running' ]]; then + elif [[ "$ans" == dc* ]] && [[ "${DMRState[2]}" == 'running' ]]; then sudo journalctl -u ${DMRProcess[2]} -f - elif [[ "$ans" == x* ]] && [[ "${YSFState[0]}" == 'running' ]]; then + elif [[ "$ans" == ya* ]] && [[ "${YSFState[0]}" == 'running' ]]; then sudo journalctl -u ${YSFProcess[0]} -f - elif [[ "$ans" == y* ]] && [[ "${YSFState[1]}" == 'running' ]]; then + elif [[ "$ans" == yb* ]] && [[ "${YSFState[1]}" == 'running' ]]; then sudo journalctl -u ${YSFProcess[1]} -f - elif [[ "$ans" == z* ]] && [[ "${YSFState[2]}" == 'running' ]]; then + elif [[ "$ans" == yc* ]] && [[ "${YSFState[2]}" == 'running' ]]; then sudo journalctl -u ${YSFProcess[2]} -f + elif [[ "$ans" == p* ]] && [[ "${APRSState}" == 'running' ]]; then + sudo journalctl -u aprsgateway -f fi done ans='' @@ -446,79 +424,84 @@ MaintenanceMenu () { echo " MaintenanceMenu" Header if [[ "$GateState" == 'running' ]]; then - echo " g : Stop QnetGateway" + echo " g : Stop QnetGateway" elif [[ "$GateState" == 'stopped' ]]; then - echo " g : Start QnetGateway" + echo " g : Start QnetGateway" fi if [[ "$LinkState" == 'running' ]]; then - echo " l : Stop QnetLink" + echo " l : Stop QnetLink" elif [[ "$LinkState" == 'stopped' ]]; then - echo " l : Start QnetLink" + echo " l : Start QnetLink" fi if [[ "$DTMFState" == 'running' ]]; then - echo " d : Stop DTMF" + echo " dt : Stop DTMF" elif [[ "$DTMFState" == 'stopped' ]]; then - echo " d : Start DTMF" + echo " dt : Start DTMF" fi if [[ "${ModuleState[0]}" == 'running' ]]; then - echo " a : Stop Module A" + echo " a : Stop Module A" elif [[ "${ModuleState[0]}" == 'stopped' ]]; then - echo " a : Start Module A" + echo " a : Start Module A" fi if [[ "${ModuleState[1]}" == 'running' ]]; then - echo " b : Stop Module B" + echo " b : Stop Module B" elif [[ "${ModuleState[1]}" == 'stopped' ]]; then - echo " b : Start Module B" + echo " b : Start Module B" fi if [[ "${ModuleState[2]}" == 'running' ]]; then - echo " c : Stop Module C" + echo " c : Stop Module C" elif [[ "${ModuleState[2]}" == 'stopped' ]]; then - echo " c : Start Module C" + echo " c : Start Module C" fi if [[ "${MMDVMState[0]}" == 'running' ]]; then - echo " r : Stop MMDVMHost A" + echo " ma : Stop MMDVMHost A" elif [[ "${MMDVMState[0]}" == 'stopped' ]]; then - echo " r : Start MMDVMHost A" + echo " ma : Start MMDVMHost A" fi if [[ "${MMDVMState[1]}" == 'running' ]]; then - echo " s : Stop MMDVMHost B" + echo " mb : Stop MMDVMHost B" elif [[ "${MMDVMState[1]}" == 'stopped' ]]; then - echo " s : Start MMDVMHost B" + echo " mb : Start MMDVMHost B" fi if [[ "${MMDVMState[2]}" == 'running' ]]; then - echo " t : Stop MMDVMHost C" + echo " mc : Stop MMDVMHost C" elif [[ "${MMDVMState[2]}" == 'stopped' ]]; then - echo " t : Start MMDVMHost C" + echo " mc : Start MMDVMHost C" fi if [[ "${DMRState[0]}" == 'running' ]]; then - echo " u : Stop DMRGateway A" + echo " da : Stop DMRGateway A" elif [[ "${DMRState[0]}" == 'stopped' ]]; then - echo " u : Start DMRGateway A" + echo " da : Start DMRGateway A" fi if [[ "${DMRState[1]}" == 'running' ]]; then - echo " v : Stop DMRGateway B" + echo " db : Stop DMRGateway B" elif [[ "${DMRState[1]}" == 'stopped' ]]; then - echo " v : Start DMRGateway B" + echo " db : Start DMRGateway B" fi if [[ "${DMRState[2]}" == 'running' ]]; then - echo " w : Stop DMRGateway C" + echo " dc : Stop DMRGateway C" elif [[ "${DMRState[2]}" == 'stopped' ]]; then - echo " w : Start DMRGateway C" + echo " dc : Start DMRGateway C" fi if [[ "${YSFState[0]}" == 'running' ]]; then - echo " x : Stop YSFGateway A" + echo " ya : Stop YSFGateway A" elif [[ "${YSFState[0]}" == 'stopped' ]]; then - echo " x : Start YSFGateway A" + echo " ys : Start YSFGateway A" fi if [[ "${YSFState[1]}" == 'running' ]]; then - echo " y : Stop YSFGateway B" + echo " yb : Stop YSFGateway B" elif [[ "${YSFState[1]}" == 'stopped' ]]; then - echo " y : Start YSFGateway B" + echo " yb : Start YSFGateway B" fi if [[ "${YSFState[2]}" == 'running' ]]; then - echo " z : Stop YSFGateway C" + echo " yc : Stop YSFGateway C" elif [[ "${YSFState[2]}" == 'stopped' ]]; then - echo " z : Start YSFGateway C" + echo " yc : Start YSFGateway C" + fi + if [[ "${APRSState}" == 'running' ]]; then + echo " p : Stop APRSGateway" + elif [[ "${APRSState}" == 'stopped' ]]; then + echo " p : Start APRSGateway" fi echo echo " q : Return to main Menu" @@ -539,7 +522,7 @@ MaintenanceMenu () { sudo systemctl start qnlink fi BaseStatus - elif [[ "$ans" == d* ]]; then + elif [[ "$ans" == dt* ]]; then if [[ "$DTMFState" == 'running' ]]; then sudo systemctl stop qndtmf elif [[ "$DTMFState" == 'stopped' ]]; then @@ -567,69 +550,76 @@ MaintenanceMenu () { sudo systemctl start ${ModuleProcess[2]} fi ModuleStatus 2 c $module_c - elif [[ "$ans" == r* ]] && [ -n $module_a ]; then + elif [[ "$ans" == ma* ]] && [ -n $module_a ]; then if [[ "${MMDVMState[0]}" == 'running' ]]; then sudo systemctl stop ${MMDVMProcess[0]} elif [[ "${MMDVMState[0]}" == 'stopped' ]]; then sudo systemctl start ${MMDVMProcess[0]} fi ModuleStatus 0 a $module_a - elif [[ "$ans" == s* ]] && [ -n $module_b ]; then + elif [[ "$ans" == mb* ]] && [ -n $module_b ]; then if [[ "${MMDVMState[1]}" == 'running' ]]; then sudo systemctl stop ${MMDVMProcess[1]} elif [[ "${MMDVMState[1]}" == 'stopped' ]]; then sudo systemctl start ${MMDVMProcess[1]} fi ModuleStatus 1 b $module_b - elif [[ "$ans" == r* ]] && [ -n $module_c ]; then + elif [[ "$ans" == mc* ]] && [ -n $module_c ]; then if [[ "${MMDVMState[2]}" == 'running' ]]; then sudo systemctl stop ${MMDVMProcess[2]} elif [[ "${MMDVMState[2]}" == 'stopped' ]]; then sudo systemctl start ${MMDVMProcess[2]} fi ModuleStatus 2 c $module_c - elif [[ "$ans" == u* ]] && [ -n $module_a ]; then + elif [[ "$ans" == da* ]] && [ -n $module_a ]; then if [[ "${DMRState[0]}" == 'running' ]]; then sudo systemctl stop ${DMRProcess[0]} elif [[ "${DMRState[0]}" == 'stopped' ]]; then sudo systemctl start ${DMRrocess[0]} fi ModuleStatus 0 a $module_a - elif [[ "$ans" == v* ]] && [ -n $module_b ]; then + elif [[ "$ans" == db* ]] && [ -n $module_b ]; then if [[ "${DMRState[1]}" == 'running' ]]; then sudo systemctl stop ${DMRProcess[1]} elif [[ "${DMRState[1]}" == 'stopped' ]]; then sudo systemctl start ${DMRProcess[1]} fi ModuleStatus 1 b $module_b - elif [[ "$ans" == w* ]] && [ -n $module_c ]; then + elif [[ "$ans" == dc* ]] && [ -n $module_c ]; then if [[ "${DMRState[2]}" == 'running' ]]; then sudo systemctl stop ${DMRProcess[2]} elif [[ "${DMRState[2]}" == 'stopped' ]]; then sudo systemctl start ${DMRProcess[2]} fi ModuleStatus 2 c $module_c - elif [[ "$ans" == x* ]] && [ -n $module_a ]; then + elif [[ "$ans" == ya* ]] && [ -n $module_a ]; then if [[ "${YSFState[0]}" == 'running' ]]; then sudo systemctl stop ${YSFProcess[0]} elif [[ "${YSFState[0]}" == 'stopped' ]]; then sudo systemctl start ${YSFProcess[0]} fi ModuleStatus 0 a $module_a - elif [[ "$ans" == y* ]] && [ -n $module_b ]; then + elif [[ "$ans" == yb* ]] && [ -n $module_b ]; then if [[ "${YSFState[1]}" == 'running' ]]; then sudo systemctl stop ${YSFProcess[1]} elif [[ "${YSFState[1]}" == 'stopped' ]]; then sudo systemctl start ${YSFProcess[1]} fi ModuleStatus 1 b $module_b - elif [[ "$ans" == z* ]] && [ -n $module_c ]; then + elif [[ "$ans" == yc* ]] && [ -n $module_c ]; then if [[ "${YSFState[2]}" == 'running' ]]; then sudo systemctl stop ${YSFProcess[2]} elif [[ "${YSFState[2]}" == 'stopped' ]]; then sudo systemctl start ${YSFProcess[2]} fi ModuleStatus 2 c $module_c + elif [[ "$ans" == p* ]]; then + if [[ "${APRSState}" == 'running' ]]; then + sudo systemctl stop ${APRSProcess} + elif [[ "${APRSState}" == 'stopped' ]]; then + sudo systemctl start ${APRSProcess} + fi + BaseStatus fi done ans='' @@ -742,7 +732,7 @@ else echo "ERROR: There is no Makefile or makefile" exit 1 fi -source <( grep -e '^BINDIR=' -e '^MMPATH=' -e '^DMRPATH=' -e '^YSFPATH=' $MAKEFILE ) +source <( grep -e '^BINDIR=' -e '^MMPATH=' -e '^DMRPATH=' -e '^YSFPATH=' -e '^APRSPATH' $MAKEFILE ) if [ -z $BINDIR ]; then echo "ERROR: The BINDIR definition in $MAKEFILE is empty!" exit 1