summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/rrd_stats/rrd_stats.install
diff options
context:
space:
mode:
authorBob Igo <bob@stormlogic.com>2009-06-16 18:15:36 (GMT)
committerBob Igo <bob@stormlogic.com>2009-06-16 18:15:36 (GMT)
commit7ea54e94edf113f577fecc27793fe03a8a5080da (patch)
treea6b20719d265258d18680f49ae255437f2f924f9 /abs/extra-testing/rrd_stats/rrd_stats.install
parentf2af490d9405bd022455cbd81408fcd23b7cfe12 (diff)
parentc072b9f94004963781846c5fe8349a3ea8c7818f (diff)
downloadlinhes_pkgbuild-7ea54e94edf113f577fecc27793fe03a8a5080da.zip
linhes_pkgbuild-7ea54e94edf113f577fecc27793fe03a8a5080da.tar.gz
linhes_pkgbuild-7ea54e94edf113f577fecc27793fe03a8a5080da.tar.bz2
Merge branch 'master' of ssh://igo@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/extra-testing/rrd_stats/rrd_stats.install')
-rw-r--r--abs/extra-testing/rrd_stats/rrd_stats.install61
1 files changed, 50 insertions, 11 deletions
diff --git a/abs/extra-testing/rrd_stats/rrd_stats.install b/abs/extra-testing/rrd_stats/rrd_stats.install
index be3d2e9..d6aa4ed 100644
--- a/abs/extra-testing/rrd_stats/rrd_stats.install
+++ b/abs/extra-testing/rrd_stats/rrd_stats.install
@@ -1,22 +1,61 @@
post_install() {
- line="*/5 * * * * /usr/local/bin/rrd_hddtemp.pl > /dev/null"
- (crontab -l; echo "$line") | crontab -
- line="*/5 * * * * /usr/local/bin/rrd_disk.pl > /dev/null"
- (crontab -l; echo "$line") | crontab -
- line="*/5 * * * * /usr/local/bin/rrd_traffic.pl > /dev/null"
- (crontab -l; echo "$line") | crontab -
- line="*/5 * * * * /usr/local/bin/rrd_mem.pl > /dev/null"
- (crontab -l; echo "$line") | crontab -
- line="*/5 * * * * /usr/local/bin/rrd_cpu.pl > /dev/null"
- (crontab -l; echo "$line") | crontab -
+ PFIX="/data/srv/httpd/htdocs/rrd"
+ if [ ! -e $PFIX/index.html.orig ]
+ then
+ mv $PFIX/index.html $PFIX/index.html.orig
+ ln -s $PFIX/index-rrd.html $PFIX/index.html
+ fi
+
+ ct=`crontab -l`
+ echo $ct | grep -q rrd_hddtemp.pl
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/rrd_hddtemp.pl > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
+ echo $ct | grep -q rrd_disk.pl
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/rrd_disk.pl > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
+ echo $ct | grep -q rrd_traffic.pl
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/rrd_traffic.pl > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
+ echo $ct | grep -q rrd_mem.pl
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/rrd_mem.pl > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
+ echo $ct | grep -q rrd_cpu.pl
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/rrd_cpu.pl > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
}
post_upgrade() {
- /bin/true
+ post_install $1
}
pre_remove() {
crontab -l | grep -v rrd_ | crontab -
+ PFIX="/data/srv/httpd/htdocs/rrd"
+ if [ -e $PFIX/index.html.orig ]
+ then
+ rm $PFIX/index.html
+ mv $PFIX/index.html.orig $PFIX/index.html
+ fi
}