summaryrefslogtreecommitdiffstats
path: root/munin-node/munin-node.install
blob: 2f190f49a02b6b0ea254e668aba97ee0225cce71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 $*