From 7400824ad2ba8610c9d1a6c5ad892028af2800a5 Mon Sep 17 00:00:00 2001 From: "Evan J. Felix" Date: Thu, 4 Aug 2022 10:08:31 -0700 Subject: [PATCH] Check For netplan, use it to detect static ips if possible --- xCAT-probe/lib/perl/probe_utils.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index fa31e84e7d..a22ebc861e 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -197,6 +197,15 @@ sub is_static_ip { } } + `which netplan > /dev/null 2>&1`; + unless ($?) { + my $dhcp_status = `netplan get ethernets.$nic.dhcp4 2>&1`; + unless ($?) { + $rst = 1 if ( $dhcp_status =~ /false/); + return $rst; + } + } + if ($os =~ /redhat/) { my $output1 = `cat /etc/sysconfig/network-scripts/ifcfg-$nic 2>&1 |grep -i IPADDR`; my $output2 = `cat /etc/sysconfig/network-scripts/ifcfg-$nic 2>&1 |grep -i BOOTPROTO`;