blob: e5dd6575a193f00c19c178b60295bd6456f25c87 (
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
|
#/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:
|