summaryrefslogtreecommitdiffstats
path: root/munin-node/munin-node.install
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-08-20 19:20:36 +0200
committerFlorian Pritz <bluewind@xssn.at>2009-08-20 19:20:36 +0200
commitf0d152ea0fe92423f39a487e97908d409f98047b (patch)
tree6396fb8e6a851f46f0cfc978c4720b3d2c3726b5 /munin-node/munin-node.install
parent4955b0d9fc05950c5794c9cc37923deb00e9cfa5 (diff)
downloadaur-packages-f0d152ea0fe92423f39a487e97908d409f98047b.tar.gz
aur-packages-f0d152ea0fe92423f39a487e97908d409f98047b.tar.xz
some updates again
Diffstat (limited to 'munin-node/munin-node.install')
-rw-r--r--munin-node/munin-node.install34
1 files changed, 34 insertions, 0 deletions
diff --git a/munin-node/munin-node.install b/munin-node/munin-node.install
new file mode 100644
index 0000000..2f190f4
--- /dev/null
+++ b/munin-node/munin-node.install
@@ -0,0 +1,34 @@
+# arg 1: the new package version
+post_install () {
+
+# Check user/group munin exists
+
+ getent group munin > /dev/null || groupadd munin
+ getent passwd munin > /dev/null || useradd -c "Munin system monitor" -g munin -s /bin/false -d /var/munin munin
+
+# Fix permissions
+ chown munin.munin -R /var/log/munin /var/munin /var/run/munin
+
+
+# Do basic configuration
+
+ echo "==> Configuring default plugins for this system"
+ /sbin/munin-node-configure --shell | sh
+
+ echo "==> To use the SNMP plugins you will need perl-net-snmp"
+
+}
+
+pre_remove() {
+
+# Only remove the user if munin is not installed,
+# because both packages need this user
+ killall munin-node
+ pacman -Q munin >& /dev/null || ( /usr/sbin/userdel munin >& /dev/null ; \
+ /usr/sbin/groupdel munin >& /dev/null )
+}
+
+op=$1
+shift
+
+$op $*