commit
This commit is contained in:
22
debian/split_config
vendored
Executable file
22
debian/split_config
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
DESTDIR=$1
|
||||
|
||||
echo "splitting the monolithic config into separate sections..." 1>&2
|
||||
|
||||
for sec in General Alerts Database Presentation Probes Slaves Targets
|
||||
do
|
||||
if [ ! -f ${DESTDIR}/etc/smokeping/config.d/$sec ]; then
|
||||
sed -n "0,/^\*\*\* $sec \*\*\*/{h;d}; \${g;p;q}; /^\*\*\*/{g;p;q}; H" \
|
||||
< ${DESTDIR}/etc/smokeping/config > ${DESTDIR}/etc/smokeping/config.d/$sec
|
||||
fi
|
||||
done
|
||||
|
||||
egrep 'sendmail|imgcache|imgurl|datadir|dyndir|piddir|smokemail|tmail' ${DESTDIR}/etc/smokeping/config.d/General > ${DESTDIR}/etc/smokeping/config.d/pathnames
|
||||
echo 'dyndir = /var/lib/smokeping/__cgi' >> ${DESTDIR}/etc/smokeping/config.d/pathnames
|
||||
|
||||
sed -i '/sendmail\|imgcache\|imgurl\|datadir\|dyndir\|piddir\|smokemail\|tmail/d' ${DESTDIR}/etc/smokeping/config.d/General
|
||||
|
||||
echo '@include /etc/smokeping/config.d/pathnames' >> ${DESTDIR}/etc/smokeping/config.d/General
|
||||
Reference in New Issue
Block a user