summaryrefslogtreecommitdiff
path: root/testing/ntp/install
blob: e6eddf8a49c3bafe420270f497b8a3b20b1efecb (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
36
37
post_install() {
	getent group ntp &>/dev/null || groupadd -g 87 ntp >/dev/null
	getent passwd ntp &>/dev/null || useradd -u 87 -g ntp -d /var/lib/ntp -c 'Network Time Protocol' -s /bin/false ntp >/dev/null
	true
}

post_upgrade() {
	if [[ $(vercmp $2 4.2.6.p3) -le 0 ]]; then
		cat <<EOF

==> The file /etc/conf.d/ntp-client.conf has been renamed /etc/conf.d/ntpd.conf
==> If you made changes to the former, please update the latter.

EOF
	fi
	if [[ $(vercmp $2 4.2.6.p5-1) -le 0 ]]; then
		cat <<EOF

==> The PID file /var/run/ntpd.pid has been renamed /run/ntpd.pid
==> and the new rc.d script only takes the latter into account.
==> To stop your old ntpd process, please kill it manually.

EOF
	fi
	if [[ $(vercmp $2 4.2.6.p5-3) -le 0 ]]; then
		post_install
	fi
	if [[ $(vercmp $2 4.2.6.p5-5) -le 0 ]]; then
		chown -R ntp /var/lib/ntp
	fi
}

post_remove() {
	getent passwd ntp &>/dev/null && userdel ntp >/dev/null
	getent group ntp &>/dev/null && groupdel ntp >/dev/null
	true
}