2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-22 14:05:32 +00:00

syslog postscript check for config files

This commit is contained in:
Mark Gurevich
2021-11-17 11:22:12 -05:00
parent 3553d2b383
commit 67aa8a23ea

View File

@ -179,26 +179,32 @@ config_rsyslog_V8()
cp -f $conf_file $conf_file.XCATORIG
fi
# check if already an old entry by xCAT. If so, we need to remove it
grep "$xCATSettingsOLD$" $conf_file 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsOLD/,+1 d" $conf_file
if [ -e $conf_file ]; then
# check if already an old entry by xCAT. If so, we need to remove it
grep "$xCATSettingsOLD$" $conf_file 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsOLD/,+1 d" $conf_file
fi
# check if already a previous entry by xCAT. If so, we need to remove it
grep "$xCATSettingsSTART" $conf_file 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsSTART/,/$xCATSettingsEND/ d" $conf_file
fi
fi
grep "$xCATSettingsOLD$" $remoteconf 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsOLD/,+1 d" $remoteconf
fi
if [ -e $remoteconf ]; then
# check if already an old entry by xCAT. If so, we need to remove it
grep "$xCATSettingsOLD$" $remoteconf 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsOLD/,+1 d" $remoteconf
fi
# check if already a previous entry by xCAT. If so, we need to remove it
grep "$xCATSettingsSTART" $conf_file 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsSTART/,/$xCATSettingsEND/ d" $conf_file
fi
grep "$xCATSettingsSTART" $remoteconf 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsSTART/,/$xCATSettingsEND/ d" $remoteconf
# check if already a previous entry by xCAT. If so, we need to remove it
grep "$xCATSettingsSTART" $remoteconf 2>&1 1> /dev/null
if [ $? -eq 0 ]; then
sed -i "/$xCATSettingsSTART/,/$xCATSettingsEND/ d" $remoteconf
fi
fi
if [ $goLocal -eq 1 ]; then