I've seen two issues when diversion is doing a backup of ipleases to /tmp/divstats-iphostleases.txt.
1. When trying to get check whether the hostname is known or it should put "(Name-N/A)", it uses this:
The issue is that grep always ends up in the first branch and outputs (Name-N/A) even when the name is present. The correct way to do this is to escape * so it will look like:
or alternatively:
2. Diversion assumes that DHPC leases are done within in the network where only the last number of IPv4 is changing (i.e. DHCP range is defined like 192.168.1.2 - 192.168.1.254). If falls short if it's not.
I've split my network and I'm using wider range (my DHCP range is 172.1x.0.2 - 172.1x.255.254).
The changed code (with the change for the point 1 as well) for your consideration is this gist.
It replaces the code in file functions.div in function c_stats, the case block for value 5.
My router is:
RT-AX82U (armv7l) Kernel-4.1.52
FW-3004.388.92-gnuton2 @ *my.local.ip*
Thanks,
1. When trying to get check whether the hostname is known or it should put "(Name-N/A)", it uses this:
Bash:
if grep -wq "$i *" /var/lib/misc/dnsmasq.leases; then
echo " $i (Name-N/A)" >>/tmp/divstats-iphostleases
else
echo " $(awk -v var="$i" -F' ' '$3 == var{print $3, $4}' /var/lib/misc/dnsmasq.leases)" >>/tmp/divstats-iphostleases
fi
fi
The issue is that grep always ends up in the first branch and outputs (Name-N/A) even when the name is present. The correct way to do this is to escape * so it will look like:
Code:
if grep -wq "$i \*" /var/lib/misc/dnsmasq.leases; then
Code:
if grep -Fq "$i *" /var/lib/misc/dnsmasq.leases; then
2. Diversion assumes that DHPC leases are done within in the network where only the last number of IPv4 is changing (i.e. DHCP range is defined like 192.168.1.2 - 192.168.1.254). If falls short if it's not.
I've split my network and I'm using wider range (my DHCP range is 172.1x.0.2 - 172.1x.255.254).
The changed code (with the change for the point 1 as well) for your consideration is this gist.
It replaces the code in file functions.div in function c_stats, the case block for value 5.
My router is:
RT-AX82U (armv7l) Kernel-4.1.52
FW-3004.388.92-gnuton2 @ *my.local.ip*
Thanks,
