From 5921efb1a6e5a491fae949c34e60f478c88f9fcd Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 24 Feb 2010 09:44:42 +0000 Subject: [PATCH] defect 2954181: add code logic to handle the case that new dhcpd which does not write the *.info file git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5287 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/xcatdsklspost | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 67bcf55fc..49959475d 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -136,6 +136,21 @@ if [ $downloaded -eq 0 ]; then if [ $? -eq 0 ]; then downloaded=1 fi + elif [ -x "/sbin/dhcpcd" ]; then + # New dhcpcd doesn't creates *.info files. + for lease in $(ls "/var/lib/dhcpcd/"); do + iface="$(echo "$lease" | sed -n -e 's/^dhcpcd-\(.*\)\.lease$/\1/p')" + if [ -n "$iface" ]; then + SIP="$(dhcpcd -q -T "$iface" | sed -n -e '/new_dhcp_server_identifier/ s/.*=//p')" + if [ -n "$SIP" ]; then + download_postscripts $SIP + if [ $? -eq 0 ]; then + downloaded=1 + break + fi + fi + fi + done fi fi