summarylogtreecommitdiffstats
path: root/nsca.install
blob: 02533b57972a5fcb625ab72d49fb45cf26fd72e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
post_install() {
  if [ -z "$(getent group nsca)" ]; then
    groupadd -g 32 nsca
  fi
  if [ -z "$(getent passwd nsca)" ]; then
    useradd -u 32 -g nsca -c "Nagios NSCA" -d /dev/null -s /bin/false nsca
  fi
}

post_upgrade() {
  post_install $1
}

pre_remove() {
  userdel nsca &> /dev/null
  groupdel nsca &> /dev/null
}

op=$1
shift

$op $*