diff --git a/QnetGateway.cpp b/QnetGateway.cpp index 6265fc7..baa4fa9 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -992,7 +992,7 @@ void CQnetGateway::ProcessSlowData(unsigned char *data, unsigned short sid) } } -void CQnetGateway::ProcessG2(ssize_t g2buflen, SDSVT &g2buf, bool is_from_g2) +void CQnetGateway::ProcessG2(const ssize_t g2buflen, const SDSVT &g2buf, const bool is_from_g2) // is_from_g2==true means it's coming from external port 40000 // is_from_g2==false means it's coming from the link2gate Unix socket { diff --git a/QnetGateway.h b/QnetGateway.h index 6e54e31..507bbc8 100644 --- a/QnetGateway.h +++ b/QnetGateway.h @@ -169,7 +169,7 @@ private: void APRSBeaconThread(); void ProcessTimeouts(); void ProcessSlowData(unsigned char *data, unsigned short sid); - void ProcessG2(ssize_t g2buflen, SDSVT &g2buf, bool is_from_g2); + void ProcessG2(const ssize_t g2buflen, const SDSVT &g2buf, const bool is_from_g2); void ProcessModem(); bool Flag_is_ok(unsigned char flag); diff --git a/get_gwy_list.sh b/get_gwy_list.sh deleted file mode 100755 index d6de493..0000000 --- a/get_gwy_list.sh +++ /dev/null @@ -1,5 +0,0 @@ -#/bin/bash - -mv -f gwys.txt gwys.txt.bak - -wget http://www.va3uv.com/gwys.txt diff --git a/get_reflectors.sh b/get_reflectors.sh deleted file mode 100755 index fe62c66..0000000 --- a/get_reflectors.sh +++ /dev/null @@ -1,30 +0,0 @@ -#/bin/bash - -# Get the big list from Ramesh (VA3UV) and extract the DCS, DStar and XReflectors only. -# Put XREF reflectors on port 20001 so they will use DPlus linking! -# -# 73 -# -# Tom, n7tae (at) arrl (dot) net - -if [ -e gwys.txt ]; then - mv -f gwys.txt gwys.txt.orig -fi - -rm -f gwys.va2uv.txt - -wget -nv -O gwys.va3uv.txt http://www.va3uv.com/gwys.txt - -if [ -e gwys.va3uv.txt ]; then - echo "# from www.va3uv.com on `date`" > gwys.txt - echo "Got `awk '$1~/^REF/{print $1, $2, $3}' gwys.va3uv.txt | tee -a gwys.txt | wc -l` REF reflectors" - # Move DPlus and DExtra to port 20001 - echo "Got `awk '$1~/^XRF/{print $1, $2, 20001}' gwys.va3uv.txt | tee -a gwys.txt | wc -l` XRF reflectors" - echo "Got `awk '$1~/^DCS/{print $1, $2, $3}' gwys.va3uv.txt | tee -a gwys.txt | wc -l` DCS reflectors" -else - echo "Could not get gateways list from www.va3uv.com!" - if [ -e gwys.txt.orig ]; then - mv -f gwys.txt.orig gwys.txt - fi -fi - diff --git a/qnadmin b/qnadmin index 49fe676..51c94b4 100755 --- a/qnadmin +++ b/qnadmin @@ -341,6 +341,61 @@ MaintenanceMenu () { ans='' } +GatewayMenu () { + ans='' + while [[ "$ans" != q* ]]; do + local refcount=$( grep -s "^REF" gwys.txt | wc -l ) + local dcscount=$( grep -s "^DCS" gwys.txt | wc -l ) + local xrfcount=$( grep -s "^XRF" gwys.txt | wc -l ) + local repcount=$( grep -s -v "^#" gwys.txt | grep -s -v -e "^REF" -e "^DCS" -e "^XRF" | wc -l ) + clear + echo + echo " Gateway File" + echo + echo " $refcount REF, $dcscount DCS, $xrfcount XRF and $repcount Repeaters" + echo + echo " All initialization will overwrite any existing file!" + echo "ip : Initialize gwys.txt using www.PiStar.uk/downloads" + echo "iv : Initialize gwys.txt using VA3UV.com (includes a large # of repeaters)" + echo "ir : Initialize gwys.txt using VA3UV.com (but just the reflectors)" + echo "n : Edit gwys.txt file with nano" + echo "v : Edit gwys.txt file with vi" + echo + echo "q : Quit and return to Main Menu" + echo + read -p "Command: " ans + if [[ "$ans" == ip* ]]; then + /usr/bin/wget http://www.pistar.uk/downloads/DExtra_Hosts.txt + /usr/bin/wget http://www.pistar.uk/downloads/DPlus_Hosts.txt + /usr/bin/wget http://www.pistar.uk/downloads/DCS_Hosts.txt + /bin/rm -f gwys.txt + echo "# Downloaded from www.pistar.uk `date`" > gwys.txt + awk '$1 ~ /^REF/ { printf "%s %s 20001\n", $1, $2 }' DPlus_Hosts.txt >> gwys.txt + awk '$1 ~ /^XRF/ { printf "%s %s 30001\n", $1, $2 }' DExtra_Hosts.txt >> gwys.txt + awk '$1 ~ /^DCS/ { printf "%s %s 30051\n", $1, $2 }' DCS_Hosts.txt >> gwys.txt + /bin/rm -f D{Extra,Plus,CS}_Hosts.txt + elif [[ "$ans" == iv* ]]; then + /bin/rm -f gwys.txt + wget http://www.va3uv.com/gwys.txt + elif [[ "$ans" == ir* ]]; then + /bin/rm -f gwys.txt + /usr/bin/wget -nv -O gwys.va3uv.txt http://www.va3uv.com/gwys.txt + if [ -e gwys.va3uv.txt ]; then + echo "# Downloaded from www.va3uv.com `date`" > gwys.txt + awk '$1~/^REF/{print $1, $2, $3}' gwys.va3uv.txt >> gwys.txt + awk '$1~/^XRF/{print $1, $2, $3}' gwys.va3uv.txt >> gwys.txt + awk '$1~/^DCS/{print $1, $2, $3}' gwys.va3uv.txt >> gwys.txt + rm -f gwys.va3uv.txt + fi + elif [[ "$ans" == n* ]]; then + nano gwys.txt + elif [[ "$ans" == v* ]]; then + vi gwys.txt + fi + done + ans='' +} + # get defined modules from the config file if [ -e qn.cfg ]; then source <( grep "^module_[abc]=" qn.cfg ) @@ -410,10 +465,15 @@ while [[ "$ans" != q* ]]; do ModuleStatus 2 c "$module_c" echo if [[ "$GateState" == 'not installed' ]] || [[ "$LinkState" == 'not installed' ]]; then - echo "is : Install configured system" + if [ -e gwys.txt ]; then + echo "is : Install configured system" + else + echo " You must set-up your gwys.txt file before installation." + fi else echo "us : Uninstall configured System" fi + echo "gw : Gateway File Menu" if [[ "$DTMFState" == 'not installed' ]]; then echo "id : Install DTMF" else @@ -431,10 +491,14 @@ while [[ "$ans" != q* ]]; do # EXECUTE COMMANDS if [[ "$ans" == is* ]]; then InstallSystem + echo 'Wait for a few seconds for everything to start...' + sleep 5 elif [[ "$ans" == us* ]]; then InstallSystem un elif [[ "$ans" == id* ]]; then sudo make installdtmf + elif [[ "$ans" == gw* ]]; then + GatewayMenu elif [[ "$ans" == ud* ]]; then sudo make uninstalldtmf elif [[ "$ans" == c* ]]; then diff --git a/reflist.sh b/reflist.sh deleted file mode 100755 index b8a58a6..0000000 --- a/reflist.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -/usr/bin/wget http://www.pistar.uk/downloads/DExtra_Hosts.txt -/usr/bin/wget http://www.pistar.uk/downloads/DPlus_Hosts.txt -/usr/bin/wget http://www.pistar.uk/downloads/DCS_Hosts.txt - -/bin/rm -f gwys.txt - -echo "# Downloaded from www.pistar.uk `date`" > gwys.txt -awk '$1 ~ /^REF/ { printf "%s %s 20001\n", $1, $2 }' DPlus_Hosts.txt >> gwys.txt -awk '$1 ~ /^XRF/ { printf "%s %s 30001\n", $1, $2 }' DExtra_Hosts.txt >> gwys.txt -awk '$1 ~ /^DCS/ { printf "%s %s 30051\n", $1, $2 }' DCS_Hosts.txt >> gwys.txt - -/bin/rm -f D{Extra,Plus,CS}_Hosts.txt