summaryrefslogtreecommitdiffstats
path: root/abs/extra/rrd_stats/rrd_stats.install
diff options
context:
space:
mode:
Diffstat (limited to 'abs/extra/rrd_stats/rrd_stats.install')
-rw-r--r--abs/extra/rrd_stats/rrd_stats.install34
1 files changed, 34 insertions, 0 deletions
diff --git a/abs/extra/rrd_stats/rrd_stats.install b/abs/extra/rrd_stats/rrd_stats.install
new file mode 100644
index 0000000..126e4f0
--- /dev/null
+++ b/abs/extra/rrd_stats/rrd_stats.install
@@ -0,0 +1,34 @@
+post_install() {
+ 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 run_rrd.sh
+ if [ $? != 0 ]
+ then
+ line="*/5 * * * * /usr/bin/run_rrd.sh > /dev/null"
+ (crontab -l; echo "$line") | crontab -
+ fi
+
+
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+
+pre_remove() {
+ crontab -l | grep -v run_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
+
+}