From 7a65a910b77ad191d69881098c47f9b0c852d92e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 13 Aug 2013 01:33:19 -0700 Subject: Tue Aug 13 01:31:08 PDT 2013 --- community/znc/znc.install | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 community/znc/znc.install (limited to 'community/znc/znc.install') diff --git a/community/znc/znc.install b/community/znc/znc.install new file mode 100644 index 000000000..e5dd6575a --- /dev/null +++ b/community/znc/znc.install @@ -0,0 +1,29 @@ +#/bin/sh + +# arg 1: the new package version +post_install() { + getent group znc >/dev/null || groupadd -g 136 znc + getent passwd znc >/dev/null || useradd -r -d /var/lib/znc -u 136 -g 136 znc + [ -d /var/lib/znc ] || install -dm 750 -o znc -g znc /var/lib/znc + echo "==> Use 'znc --makeconf' as user znc to generate your first config" + true +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + if [ "`vercmp $2 1.0-4`" -lt 0 ]; then + [ -d /var/lib/znc ] || install -dm 750 -o znc -g znc /var/lib/znc + usermod -d /var/lib/znc znc 2>/dev/null && echo '==> znc home directory has moved to /var/lib/znc' + fi + true +} + +# arg 1: the old package version +post_remove() { + userdel -f znc >/dev/null 2>&1 + groupdel znc >/dev/null 2>&1 + true +} + +# vim:set ts=2 sw=2 ft=sh et: -- cgit v1.2.3-54-g00ecf