From 37c05a00aaee2ac030b5d47810702a0d9a13ec89 Mon Sep 17 00:00:00 2001 From: sjing Date: Thu, 9 Feb 2012 11:28:02 +0000 Subject: [PATCH] support and fix the bug when site.ntpservers is blank. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11524 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/setupntp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index b2ef081a6..84e3f7a82 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -56,7 +56,7 @@ logger -t xcat "Install: Setup NTP" # else use the master which should be a service node if [ "$master" = "$sitemaster" ]; then if [ $NTPSERVERS ]; then - if [ "$NODESETSTATE" = "statelite" ]; then + if [ "$NTPSERVERS" = "<xcatmaster>" ] || [ "$NTPSERVERS" = "" ]; then cp -a $conf_file $conf_file_org echo "" > $conf_file else @@ -66,14 +66,17 @@ if [ "$master" = "$sitemaster" ]; then mv -f $conf_file $conf_file_backup fi fi - for i in $(echo $NTPSERVERS | tr ',' ' ') - do - echo "server $i" >>$conf_file - master=$i - done + if [ "$NTPSERVERS" = "<xcatmaster>" ]; then + echo "server $master" >>$conf_file + else + for i in $(echo $NTPSERVERS | tr ',' ' ') + do + echo "server $i" >>$conf_file + master=$i + done + fi else - logger -t xcat "Install: $NTPSERVERS don't exist" - exit 0 + echo "server $master" >$conf_file fi else