summarylogtreecommitdiffstats
path: root/kannel.install
blob: 002ef8acb200dee7174930ab1ff7fd0de78a36db (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
35
# arg 1:  the new package version
post_install() {
	getent group kannel >/dev/null 2>&1 || groupadd -r kannel
	if getent passwd kannel >/dev/null 2>&1; then
		usermod -d /run/kannel -c 'Kannel Daemon' \
			-s /usr/bin/nologin kannel >/dev/null 2>&1
	else
		useradd -r -c 'Kannel Daemon' -g kannel \
			-d /run/kannel -s /usr/bin/nologin kannel >/dev/null 2>&1
	fi
	groupmems -g uucp -a kannel >/dev/null 2>&1
	passwd -l kannel >/dev/null 2>&1
	chown root:kannel $pkgdir/var/log/kannel
  chmod -R 0770 $pkgdir/var/log/kannel
	chown root:kannel $pkgdir/var/spool/kannel
  chmod -R 0770 $pkgdir/var/spool/kannel
	systemd-tmpfiles --create /usr/lib/tmpfiles.d/kannel.conf >/dev/null 2>&1
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
	post_install $1
	systemctl --system daemon-reload >/dev/null 2>&1
}

# arg 1:  the old package version
pre_remove() {
  systemctl -qf stop kannel-smsbox
  systemctl -qf stop kannel-wapbox
  systemctl -qf stop kannel-bearerbox
	getent passwd kannel >/dev/null 2>&1 && userdel kannel
	getent group kannel >/dev/null 2>&1 && groupdel kannel
}