gwinfo: Bump to 1.4.4 (two DHCP processing fixes)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-08-29 10:44:54 +02:00
parent c26c5e79e4
commit a56ff652d1
1 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,9 @@
# #
# designed for GATEWAY SERVER # designed for GATEWAY SERVER
# #
# v1.4.4 - 2018-08-29
# - Fix two bugs regarding DHCP range processing
#
# v1.4.3 - 2018-08-28 # v1.4.3 - 2018-08-28
# - Added version to json # - Added version to json
# #
@ -62,13 +65,15 @@ for netif in $(ls /sys/class/net); do
ipv6="$(ip -6 addr show dev "$netif" | grep " fd43" | sed 's/.*\(fd43[^ ]*\) .*/\1/')" ipv6="$(ip -6 addr show dev "$netif" | grep " fd43" | sed 's/.*\(fd43[^ ]*\) .*/\1/')"
[ "$(echo "$ipv6" | wc -l)" = "1" ] || ipv6="" [ "$(echo "$ipv6" | wc -l)" = "1" ] || ipv6=""
dhcpstart=""
dhcpend=""
if [ "$dhcp" = "1" ]; then if [ "$dhcp" = "1" ]; then
dhcpdata="$(ps ax | grep "dnsmasq" | grep "$netif " | sed 's/.*dhcp-range=\([^ ]*\) .*/\1/')" dhcpdata="$(ps ax | grep "dnsmasq" | grep "$netif " | sed 's/.*dhcp-range=\([^ ]*\) .*/\1/')"
dhcpstart="$(echo "$dhcpdata" | cut -d',' -f1)" dhcpstart="$(echo "$dhcpdata" | cut -d',' -f1)"
dhcpend="$(echo "$dhcpdata" | cut -d',' -f2)" dhcpend="$(echo "$dhcpdata" | cut -d',' -f2)"
elif [ "$dhcp" = "2" ]; then elif [ "$dhcp" = "2" ]; then
ipv4cut="${ipv4%/*}" ipv4cut="${ipv4%/*}"
if [ -n "$ipv4cut" ]; then if [ -n "$ipv4cut" ] && grep -q "$ipv4cut" /etc/dhcp/dhcpd.conf; then
dhcpdata="$(sed -z 's/.*range \([^;]*\);[^}]*option routers '$ipv4cut'.*/\1/' /etc/dhcp/dhcpd.conf)" dhcpdata="$(sed -z 's/.*range \([^;]*\);[^}]*option routers '$ipv4cut'.*/\1/' /etc/dhcp/dhcpd.conf)"
dhcpstart="$(echo "$dhcpdata" | cut -d' ' -f1)" dhcpstart="$(echo "$dhcpdata" | cut -d' ' -f1)"
dhcpend="$(echo "$dhcpdata" | cut -d' ' -f2)" dhcpend="$(echo "$dhcpdata" | cut -d' ' -f2)"