+9
-2
capsulflask/shell_scripts/ip-dhcp-host.sh
+9
-2
capsulflask/shell_scripts/ip-dhcp-host.sh
···
18
18
if [ "$action" = 'add' ]; then
19
19
printf "trying to delete any existing (probably expired) dhcp associations for $ipv4_address..."
20
20
virsh net-update "$network_name" delete ip-dhcp-host "<host ip='$ipv4_address' />" --live --config || true
21
+
22
+
printf "adding $mac_address --> $ipv4_address to $network_name"
23
+
virsh net-update "$network_name" "$action" ip-dhcp-host "<host mac='$mac_address' ip='$ipv4_address' />" --live --config
24
+
else
25
+
printf "removing $mac_address and $ipv4_address from $network_name if they exist"
26
+
virsh net-update "$network_name" "$action" ip-dhcp-host "<host mac='$mac_address' />" --live --config || true
27
+
virsh net-update "$network_name" "$action" ip-dhcp-host "<host ip='$ipv4_address' />" --live --config || true
21
28
fi
22
29
23
-
printf "adding $mac_address --> $ipv4_address to $network_name"
24
-
virsh net-update "$network_name" "$action" ip-dhcp-host "<host mac='$mac_address' ip='$ipv4_address' />" --live --config
30
+
31
+