diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index cde4cc211..0d51de150 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -46,7 +46,7 @@ network_ipv4calc () echo $NETWORK } -if (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1); then +if [ -f /etc/os-release ] && (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1); then osver="cumulus" fi diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index d39334f64..aa2a21684 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -25,7 +25,7 @@ #enable debug #set -x -if cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then +if [ -f /etc/os-release ] && cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then #TODO echo "Cumulus OS is not supported yet, nothing to do..." logger -t xcat -p local4.info "Cumulus OS is not supported yet, nothing to do..." diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index c2023426a..690ff2e97 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -12,7 +12,7 @@ # # if on the Management Node, exit -if cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then +if [ -f /etc/os-release ] && cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then #TODO echo "Cumulus OS is not supported yet, nothing to do..." logger -t xcat -p local4.info "Cumulus OS is not supported yet, nothing to do..." diff --git a/xCAT/postscripts/syncfiles b/xCAT/postscripts/syncfiles old mode 100644 new mode 100755 index 5ce495dc2..1074fe389 --- a/xCAT/postscripts/syncfiles +++ b/xCAT/postscripts/syncfiles @@ -14,7 +14,7 @@ if [ -d /.statelite ]; then exit 0 fi -if cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then +if [ -f /etc/os-release ] && cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then #TODO echo "Cumulus OS is not supported yet, nothing to do..." logger -t xcat -p local4.info "Cumulus OS is not supported yet, nothing to do..." diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index d55364e00..8705aa168 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -149,7 +149,9 @@ config_rsyslog_V8() remoteconf="/etc/rsyslog.d/remote.conf" #for Cumulus OS inside ONIE switches - cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 && remoteconf="/etc/rsyslog.d/99-syslog.conf" + if [ -f /etc/os-release ]; then + cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 && remoteconf="/etc/rsyslog.d/99-syslog.conf" + fi # If this is a Management Node or Service Node, then it will be receiving syslog entries from the # compute nodes. Management Node is receiving from Service Nodes and possibly compute nodes.