2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-18 09:10:23 +00:00

Merge pull request #7071 from gurevichmark/syslog_postscript

syslog postscript check for config files
This commit is contained in:
besawn
2021-11-18 08:40:42 -05:00
committed by GitHub

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