added gw to qnadmin

pull/12/head
Tom Early 7 years ago
parent d135f348d0
commit 45dacb59ed

@ -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==true means it's coming from external port 40000
// is_from_g2==false means it's coming from the link2gate Unix socket // is_from_g2==false means it's coming from the link2gate Unix socket
{ {

@ -169,7 +169,7 @@ private:
void APRSBeaconThread(); void APRSBeaconThread();
void ProcessTimeouts(); void ProcessTimeouts();
void ProcessSlowData(unsigned char *data, unsigned short sid); 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(); void ProcessModem();
bool Flag_is_ok(unsigned char flag); bool Flag_is_ok(unsigned char flag);

@ -1,5 +0,0 @@
#/bin/bash
mv -f gwys.txt gwys.txt.bak
wget http://www.va3uv.com/gwys.txt

@ -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

@ -341,6 +341,61 @@ MaintenanceMenu () {
ans='' 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 # get defined modules from the config file
if [ -e qn.cfg ]; then if [ -e qn.cfg ]; then
source <( grep "^module_[abc]=" qn.cfg ) source <( grep "^module_[abc]=" qn.cfg )
@ -410,10 +465,15 @@ while [[ "$ans" != q* ]]; do
ModuleStatus 2 c "$module_c" ModuleStatus 2 c "$module_c"
echo echo
if [[ "$GateState" == 'not installed' ]] || [[ "$LinkState" == 'not installed' ]]; then if [[ "$GateState" == 'not installed' ]] || [[ "$LinkState" == 'not installed' ]]; then
if [ -e gwys.txt ]; then
echo "is : Install configured system" echo "is : Install configured system"
else
echo " You must set-up your gwys.txt file before installation."
fi
else else
echo "us : Uninstall configured System" echo "us : Uninstall configured System"
fi fi
echo "gw : Gateway File Menu"
if [[ "$DTMFState" == 'not installed' ]]; then if [[ "$DTMFState" == 'not installed' ]]; then
echo "id : Install DTMF" echo "id : Install DTMF"
else else
@ -431,10 +491,14 @@ while [[ "$ans" != q* ]]; do
# EXECUTE COMMANDS # EXECUTE COMMANDS
if [[ "$ans" == is* ]]; then if [[ "$ans" == is* ]]; then
InstallSystem InstallSystem
echo 'Wait for a few seconds for everything to start...'
sleep 5
elif [[ "$ans" == us* ]]; then elif [[ "$ans" == us* ]]; then
InstallSystem un InstallSystem un
elif [[ "$ans" == id* ]]; then elif [[ "$ans" == id* ]]; then
sudo make installdtmf sudo make installdtmf
elif [[ "$ans" == gw* ]]; then
GatewayMenu
elif [[ "$ans" == ud* ]]; then elif [[ "$ans" == ud* ]]; then
sudo make uninstalldtmf sudo make uninstalldtmf
elif [[ "$ans" == c* ]]; then elif [[ "$ans" == c* ]]; then

@ -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
Loading…
Cancel
Save

Powered by TurnKey Linux.