summarylogtreecommitdiffstats
path: root/nsca.install
diff options
context:
space:
mode:
authorPhillip Smith2015-06-02 11:30:21 +1000
committerPhillip Smith2015-06-02 11:30:21 +1000
commit795cd57225971a37e63842a8e12774097090ec69 (patch)
tree0a84b5203ac7861ea72abec5c820628a4132bfeb /nsca.install
downloadaur-795cd57225971a37e63842a8e12774097090ec69.tar.gz
initial commit
Diffstat (limited to 'nsca.install')
-rw-r--r--nsca.install22
1 files changed, 22 insertions, 0 deletions
diff --git a/nsca.install b/nsca.install
new file mode 100644
index 000000000000..02533b57972a
--- /dev/null
+++ b/nsca.install
@@ -0,0 +1,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 $*