From 8b362709b47f4f4beb206c5fe7525d6fad05cba8 Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 22 Jul 2014 23:16:48 -0700 Subject: [PATCH] fix defect #4233 syslog changes give syntax error on AIX --- xCAT/postscripts/config_chef_server | 7 ++++--- xCAT/postscripts/configbond | 8 +++++--- xCAT/postscripts/configeth | 7 +++++-- xCAT/postscripts/configib | 8 ++++---- xCAT/postscripts/confignics | 7 +++++-- xCAT/postscripts/enablekdump | 6 ++++-- xCAT/postscripts/install_puppet_server | 7 ++++--- xCAT/postscripts/remoteshell | 7 ++++--- xCAT/postscripts/routeop | 7 +++++-- xCAT/postscripts/setupesx | 6 ++++-- xCAT/postscripts/setupntp | 6 ++++-- xCAT/postscripts/sudoer | 7 ++++--- xCAT/postscripts/syslog | 8 ++++---- 13 files changed, 56 insertions(+), 35 deletions(-) diff --git a/xCAT/postscripts/config_chef_server b/xCAT/postscripts/config_chef_server index b1bb266ca..538c737f4 100755 --- a/xCAT/postscripts/config_chef_server +++ b/xCAT/postscripts/config_chef_server @@ -3,9 +3,10 @@ -str_dir_name=`dirname $0` - -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi #------------------------------------------------------------------------------- diff --git a/xCAT/postscripts/configbond b/xCAT/postscripts/configbond index 9d55e5318..b709b1268 100755 --- a/xCAT/postscripts/configbond +++ b/xCAT/postscripts/configbond @@ -34,9 +34,11 @@ # NETWORKS_LINE2=netname=10_0_2_0-255_255_255_0||net=10.0.2.0||mask=255.255.255.0||mgtifname=eth0||gateway=10.0.2.2||dhcpserver=||tftpserver=10.0.2.15||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments= -# locd library for network caculation -str_dir_name=`dirname $0` -. $str_dir_name/xcatlib.sh +# load library for network caculation +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi # Subroutine to display message and pass it to syslog # Usage: showmsg "message to putput" ["error"] diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 195fab5a6..d76cd8d35 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -1,7 +1,10 @@ #!/bin/bash -str_dir_name=`dirname $0` -. $str_dir_name/xcatlib.sh + +f [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi function configipv4(){ str_if_name=$1 diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 905cbe351..d0c36b544 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -17,10 +17,10 @@ # NETWORKS_LINE2='netname=ib1||net=15.0.1.0||mask=255.255.255.0||mgtifname=||gateway=15.0.1.254||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments=' # NETWORKS_LINE3='netname=ib3||net=15.0.3.0||mask=255.255.255.0||mgtifname=||gateway=||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments=' - -str_dir_name=`dirname $0` - -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi #This is the number of ports for each ib adpator. portnum=1 diff --git a/xCAT/postscripts/confignics b/xCAT/postscripts/confignics index fe9825557..4357b017d 100755 --- a/xCAT/postscripts/confignics +++ b/xCAT/postscripts/confignics @@ -1,7 +1,10 @@ #!/bin/bash -str_dir_name=`dirname $0` -. $str_dir_name/xcatlib.sh + +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi #the nics' information contain: #1. ip address diff --git a/xCAT/postscripts/enablekdump b/xCAT/postscripts/enablekdump index 40ceca219..52b8d7c89 100755 --- a/xCAT/postscripts/enablekdump +++ b/xCAT/postscripts/enablekdump @@ -4,9 +4,11 @@ # -str_dir_name=`dirname $0` +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi -. $str_dir_name/xcatlib.sh # create /etc/sysconfig/network-scripts/ pmatch () diff --git a/xCAT/postscripts/install_puppet_server b/xCAT/postscripts/install_puppet_server index ac7cf9201..8c399ebb4 100755 --- a/xCAT/postscripts/install_puppet_server +++ b/xCAT/postscripts/install_puppet_server @@ -2,9 +2,10 @@ # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html -str_dir_name=`dirname $0` - -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi #------------------------------------------------------------------------------- #=head1 install_puppet_server diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index 5ce0aec1d..1580c519b 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -13,9 +13,10 @@ # if on the Management Node, exit -str_dir_name=`dirname $0` - -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi if [ -e /etc/xCATMN ]; then logger -t xcat -p local4.info "remoteshell:Running on the Management Node , exiting " diff --git a/xCAT/postscripts/routeop b/xCAT/postscripts/routeop index 14d66d419..091446d56 100755 --- a/xCAT/postscripts/routeop +++ b/xCAT/postscripts/routeop @@ -23,8 +23,11 @@ #=cut #------------------------------------------------------------------------------- -str_dir_name=`dirname $0` -. $str_dir_name/xcatlib.sh + +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi op=$1 diff --git a/xCAT/postscripts/setupesx b/xCAT/postscripts/setupesx index d21c290ed..40fe21f54 100755 --- a/xCAT/postscripts/setupesx +++ b/xCAT/postscripts/setupesx @@ -2,9 +2,11 @@ # example on how to set up ESX. We setup ssh and also add a basic # VLAN configuration -str_dir_name=`dirname $0` -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi logger -t xcat -p local4.info setupesx # Enable SSH access to root and exchange keys diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index db75578b4..ec2149bc4 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -7,9 +7,11 @@ #--------------------------------------------------------------------------- -str_dir_name=`dirname $0` -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi # if on the Management Node, exit if [ -e /etc/xCATMN ]; then diff --git a/xCAT/postscripts/sudoer b/xCAT/postscripts/sudoer index c15166c2d..4306413f2 100755 --- a/xCAT/postscripts/sudoer +++ b/xCAT/postscripts/sudoer @@ -8,10 +8,11 @@ #------------------------------------------------------------------------------ -str_dir_name=`dirname $0` - -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi # Configuration for the sudoer SUDOER="xcat" diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 41ddbe389..13e917fbb 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -14,10 +14,10 @@ #=cut #------------------------------------------------------------------------------- - -str_dir_name=`dirname $0` - -. $str_dir_name/xcatlib.sh +if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then + str_dir_name=`dirname $0` + . $str_dir_name/xcatlib.sh +fi master=$MASTER conf_file="/etc/syslog.conf"