2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

checking if /etc/os-release/ file is existed

This commit is contained in:
Casandra Qiu 2017-03-10 15:54:32 -05:00
parent 5ce172a932
commit bc913e0464
5 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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..."

View File

@ -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..."

2
xCAT/postscripts/syncfiles Normal file → Executable file
View File

@ -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..."

View File

@ -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.