Hello,
I have a different Setting für one XLX-Reflector followed this Instruction:
https://amateurradionotes.com/pi-star-notes.htm#addref
In the /root/XLXHostst.txt there is only one Line with the following Setting:
985;44.XXX.XXX.XX;4004
(44.XXX.XXX.XX = IP via Hamnet)
After pistar-update this line is not in the /usr/local/etc/XLXHosts.txt and I can not get a connection to the Hamnet XLX-Reflector.
What´s wrong with my Setup.
mni tnx es 73 de
Juergen
DF2AP
Different Reflector Setting in /root/XLXHosts.txt not working
Re: Different Reflector Setting in /root/XLXHosts.txt not working
Hi all,
I've found some lines in /usr/local/sbin/HostFilesUpdate.sh which are overwriting /usr/local/etc/XLXHosts.txt with the content of /root/XLXHosts.txt:
If I understand this code correctly, it reads /root/XLXHosts.txt line by line, searches a line in /usr/local/etc/XLXHosts.txt with the same XLXID (first value in each line) and REPLACES this line with a new line where ONLY the XLXROOM number from /root/XLXHosts.txt is used.
Example:
File /usr/local/etc/XLXHosts.txt contains a line
File /root/XLXHosts.txt contains a line
the resulting line in /usr/local/etc/XLXHosts.txt will be
Don't know, what's the use case for this.
I've found some lines in /usr/local/sbin/HostFilesUpdate.sh which are overwriting /usr/local/etc/XLXHosts.txt with the content of /root/XLXHosts.txt:
Code: Select all
# If there is an XLX over-ride
if [ -f "/root/XLXHosts.txt" ]; then
while IFS= read -r line; do
if [[ $line != \#* ]] && [[ $line = *";"* ]]
then
xlxid=`echo $line | awk -F ";" '{print $1}'`
xlxroom=`echo $line | awk -F ";" '{print $3}'`
xlxip=`grep "^${xlxid}" /usr/local/etc/XLXHosts.txt | awk -F ";" '{print $2}'`
xlxNewLine="${xlxid};${xlxip};${xlxroom}"
/bin/sed -i "/^$xlxid\;/c\\$xlxNewLine" /usr/local/etc/XLXHosts.txt
fi
done < /root/XLXHosts.txt
fi
Example:
File /usr/local/etc/XLXHosts.txt contains a line
Code: Select all
985;1.2.3.4;4004
Code: Select all
985;1.1.1.1;4005
Code: Select all
985;1.2.3.4;4005
73s de Thomas, DG0OFZ
Re: Different Reflector Setting in /root/XLXHosts.txt not working
Have checked my Example above by putting those lines into a small script on my linux box:
It works exactly as I understand it: It changes only the "xlxroom"-Number in /usr/local/etc/XLXHosts.txt
It works exactly as I understand it: It changes only the "xlxroom"-Number in /usr/local/etc/XLXHosts.txt
73s de Thomas, DG0OFZ
Re: Different Reflector Setting in /root/XLXHosts.txt not working
That was originally to take care of local default room numbers only, I'll look at taking in the IP also.
Re: Different Reflector Setting in /root/XLXHosts.txt not working
Change pushed - update and enjoy.
Re: Different Reflector Setting in /root/XLXHosts.txt not working
Dear sir
It means I can use /root/XLXHosts.txt to overwrite or add new XLX dmr server in the list right ?
Or I need to use /root/DMR_Hosts.txt ?
It means I can use /root/XLXHosts.txt to overwrite or add new XLX dmr server in the list right ?
Or I need to use /root/DMR_Hosts.txt ?
Re: Different Reflector Setting in /root/XLXHosts.txt not working
Sorry to bother you Andy,
But what if I want to add a custom XLX line?
pistar-update will always remove any custom line I add. May I suggest replacing line 168 in HostFilesUpdate.sh with a test, as below?
Bear in mind I am not a sed or shell guru, so there must be a better way to do it...
Regards
Rafael
That way, if such line is not found, it is appended to the file.
But what if I want to add a custom XLX line?
pistar-update will always remove any custom line I add. May I suggest replacing line 168 in HostFilesUpdate.sh with a test, as below?
Code: Select all
# If there is an XLX over-ride
if [ -f "/root/XLXHosts.txt" ]; then
while IFS= read -r line; do
if [[ $line != \#* ]] && [[ $line = *";"* ]]
then
xlxid=`echo $line | awk -F ";" '{print $1}'`
xlxip=`echo $line | awk -F ";" '{print $2}'`
#xlxip=`grep "^${xlxid}" /usr/local/etc/XLXHosts.txt | awk -F ";" '{print $2}'`
xlxroom=`echo $line | awk -F ";" '{print $3}'`
xlxNewLine="${xlxid};${xlxip};${xlxroom}"
if grep -q "^${xlxid}" /usr/local/etc/XLXHosts.txt;
then
/bin/sed -i "/^$xlxid\;/c\\$xlxNewLine" /usr/local/etc/XLXHosts.txt
else
echo $xlxNewLine >> /usr/local/etc/XLXHosts.txt
fi
fi
done < /root/XLXHosts.txt
fi
Regards
Rafael
That way, if such line is not found, it is appended to the file.