From 2e32683a5289c6431b99c45e3d18c12ca4a340b4 Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 28 Nov 2013 11:19:06 +0800 Subject: [PATCH] fix for bug 4440: write /etc/network/interfaces to /etc/network/interfaces.d/, check if the target file name is blank --- xCAT/postscripts/xcatlib.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) mode change 100644 => 100755 xCAT/postscripts/xcatlib.sh diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh old mode 100644 new mode 100755 index 76e801ded..1a115b16f --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -66,7 +66,12 @@ function debianpreconf(){ #write lines into the conffile echo $str_line >> $str_conf_file else - echo $str_line >> $str_conf_file + # Write the remaining lines of the nic conf info to conffile + # It is possible that there are some lines at the beginning of /etc/network/interfaces, + # that we could not recognize, ignore these lines. The indication is that the str_conf_file is empty + if [ ! -z "$str_conf_file" ]; then + echo $str_line >> $str_conf_file + fi fi done }