Install/Remove plugins dir in postinst/prerm scripts
authorNeutron Soutmun <neo.neutron@gmail.com>
Thu, 15 Dec 2011 18:13:05 +0000 (01:13 +0700)
committerNeutron Soutmun <neo.neutron@gmail.com>
Thu, 15 Dec 2011 18:50:58 +0000 (01:50 +0700)
* debian/cacti.{postinst,prerm}:
  - Install/Remove plugins dir which create dir at /var/lib/cacti/plugins and
    do create symlink for /usr/share/cacti/site/plugins.

debian/cacti.postinst
debian/cacti.prerm

index 3f29263..1cf9f75 100644 (file)
@@ -64,5 +64,8 @@ fi
 # remove old unused config file
 rm -f /etc/cacti/config.php
 
+test -d /var/lib/cacti/plugins || mkdir -p /var/lib/cacti/plugins
+ln -sf /var/lib/cacti/plugins /usr/share/cacti/site/plugins || true
+
 #DEBHELPER#
 exit 0
index 55bccc8..5632e36 100644 (file)
@@ -8,4 +8,6 @@ set -e
 . /usr/share/dbconfig-common/dpkg/prerm.mysql
 dbc_go cacti $@
 
+test -L /usr/share/cacti/site/plugins && rm -f /usr/share/cacti/site/plugins
+
 #DEBHELPER#