Finally getting the right combination to skip CSS headers

release-2.6.13
Eric Loyd 3 years ago
parent b5256e83ea
commit 6434c592f6

@ -69,10 +69,6 @@ do_primary() {
[ $? -ne 0 ] && error "Cannot ping ${secondary}. Use --noping to continue wihout ping." && exit [ $? -ne 0 ] && error "Cannot ping ${secondary}. Use --noping to continue wihout ping." && exit
verbose "Creating package to send to secondary" verbose "Creating package to send to secondary"
/home/nagios/bin/rsync_xi.sh --prepend ${syncname} --primary "${primary}" --secondary "${secondary}" $extraCmd /home/nagios/bin/rsync_xi.sh --prepend ${syncname} --primary "${primary}" --secondary "${secondary}" $extraCmd
if [ -r "/usr/local/nagiosxi/html/includes/components/custom-includes/css/header-gradient.css.primary" -a -w "/usr/local/nagiosxi/html/includes/components/custom-includes/css/header-gradient.css" ]; then
verbose "Copying local gradient files"
cp /usr/local/nagiosxi/html/includes/components/custom-includes/css/header-gradient.css.primary /usr/local/nagiosxi/html/includes/components/custom-includes/css/header-gradient.css
fi
} }
do_secondary() { do_secondary() {
@ -88,21 +84,20 @@ do_secondary() {
fi fi
verbose "Checking for package from the primary" verbose "Checking for package from the primary"
syncfile=$(basename `ls -tr1 ${backupDir}/${syncname}* | tail -1`) syncfile=$(basename `ls -tr1 ${backupDir}/${syncname}* | tail -1`)
if [ -r "$syncfile" ]; then fullfile="/store/backups/nagiosxi/$syncfile"
verbose " Sync file found (/store/backups/nagiosxi/$syncfile). Continuing." if [ -f "$fullfile" ]; then
/home/nagios/bin/rsync_xi.sh --primary "${primary}" --secondary "${secondary}" --file "/store/backups/nagiosxi/$syncfile" verbose " Sync file found ($fullfile). Continuing."
/home/nagios/bin/rsync_xi.sh --primary "${primary}" --secondary "${secondary}" --file "$fullfile"
else else
warning " No sync file found. Continuing to activate Nagios." warning " No sync file found. Continuing to activate Nagios."
fi fi
[ -z "$syncfile" ] && error "No sync file ($syncfile) found." && exit 2
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
sleep 2
chmod 0640 /usr/local/nagiosxi/var/keys/xi.key chmod 0640 /usr/local/nagiosxi/var/keys/xi.key
chown nagios:nagios /usr/local/nagiosxi/var/keys/xi.key chown nagios:nagios /usr/local/nagiosxi/var/keys/xi.key
verbose "This is intended to be manually executed when needed, so we assume you want to start Nagios..." -n verbose "This is intended to be manually executed when needed, so we assume you want to start Nagios..." -n
sleep 2 sleep 5
start_nagios start_nagios
rm -f ${syncfile} rm -f ${fullfile}
verbose "Done." verbose "Done."
fi fi
} }

@ -18,7 +18,7 @@ execute="-n"
syncfile="" syncfile=""
isP=/bin/false isP=/bin/false
isS=/bin/false isS=/bin/false
rsync_opts="-a --delete --delete-after --rsync-path=\"sudo /bin/rsync\" --exclude=/usr/local/nagiosxi/html/includes/components/custom-includes/css/header-gradient.css" rsync_opts="-a --delete --delete-after"
# Import Nagios XI and xi-sys.cfg config vars # Import Nagios XI and xi-sys.cfg config vars
. $BASEDIR/../var/xi-sys.cfg . $BASEDIR/../var/xi-sys.cfg
@ -118,11 +118,12 @@ workDir=$rootdir/$name
mkdir -p $workDir mkdir -p $workDir
do_rsync() { do_rsync() {
verbose "Syncing $*..." verbose "Syncing $1 (Excluding ${2:-nothing})..."
src="$1" src="$1"
[ -n "$2" ] && exclude="--exclude $2" || exclude=""
[ ! -e "$src" ] && warning " OK: No such file or directory: $src" && return [ ! -e "$src" ] && warning " OK: No such file or directory: $src" && return
[ -d "$src" ] && sudo rsync ${rsync_opts} ${execute} ${src}/ nagios@${sName}:${src}/ [ -d "$src" ] && sudo /usr/bin/rsync --rsync-path="sudo /bin/rsync" ${rsync_opts} ${exclude} ${execute} ${src}/ nagios@${sName}:${src}/
[ -f "$src" ] && sudo rsync ${rsync_opts} ${execute} ${src} nagios@${sName}:${src} [ -f "$src" ] && sudo /usr/bin/rsync --rsync-path="sudo /bin/rsync" ${rsync_opts} ${exclude} ${execute} ${src} nagios@${sName}:${src}
} }
do_backup_files() { do_backup_files() {
@ -151,7 +152,7 @@ do_rsync $httpdconfdir/nrdp.conf
do_rsync $httpdconfdir/ssl.conf do_rsync $httpdconfdir/ssl.conf
do_rsync /usr/local/nagios do_rsync /usr/local/nagios
do_rsync /usr/local/nagiosmobile do_rsync /usr/local/nagiosmobile
do_rsync /usr/local/nagiosxi do_rsync /usr/local/nagiosxi custom-includes/css/
do_rsync /usr/local/nagvis do_rsync /usr/local/nagvis
do_rsync /usr/local/nrdp do_rsync /usr/local/nrdp
do_rsync /usr/share/snmp do_rsync /usr/share/snmp

Loading…
Cancel
Save