Don't add IP address if there isn't one

This commit is contained in:
Jamie Cameron
2023-11-15 17:14:54 -08:00
parent 6926262562
commit 35bae257f2

View File

@ -287,7 +287,7 @@ if (&has_command("ip")) {
}
# Build ip command to add the new IP
if ($readd) {
if ($readd && $a->{'address'}) {
$cmd .= "ip addr add ".quotemeta($a->{'address'});
if ($a->{'netmask'}) {
$cmd .= "/".&mask_to_prefix($a->{'netmask'});