fix bashism in scripts OBS-URL: https://build.opensuse.org/request/show/266008 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/icinga?expand=0&rev=164
20 lines
419 B
Bash
20 lines
419 B
Bash
#!/bin/sh
|
|
#
|
|
# Compress old logfiles in /var/log/icinga/archives/
|
|
# once a week, if sysconfig variable is set to true
|
|
#
|
|
if [ -r /etc/sysconfig/icinga ]; then
|
|
. /etc/sysconfig/icinga
|
|
else
|
|
echo "/etc/sysconfig/icinga not found or not readable." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$ICINGA_COMPRESS_LOGFILES" = "true" ]; then
|
|
for f in /var/log/icinga/archives/*.log ; do
|
|
if [ -r "$f" ] ; then
|
|
/usr/bin/bzip2 "$f"
|
|
fi
|
|
done
|
|
fi
|