This appears to get the gateway cleanly from the active/current lease
svc_status=$( systemctl is-active wickedd-dhcp4.service )
echo $svc_status
if [ $svc_status == 'active' ]; then
data="/var/lib/wicked/lease-eth0-dhcp-ipv4.xml"
if [ -f $data ]; then
gateway=$( xml_grep 'gateway' $data --text_only )
echo $gateway
fi
fi
So for use in SHOREWALL/findgw
svc_status=$( systemctl is-active wickedd-dhcp4.service )
echo $svc_status
if [ $svc_status == 'active' ]; then
data="/var/lib/wicked/lease-${1}-dhcp-ipv4.xml"
if [ -f $data ]; then
gateway=$( xml_grep 'gateway' $data --text_only )
echo $gateway
fi
fi
That gets the gateway addr. I'm not clear whether it correctly gets the gw
addr INTO Shorewall.
Is that ^^ sufficient?
------------------------------------------------------------------------------
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users