summaryrefslogtreecommitdiff
blob: 090f0586f5cede0c2389c08272486d1b4191cc18 (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
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/htpdate/files/htpdate.init,v 1.4 2011/10/09 16:19:16 vapier Exp $

depend() {
	need net
	use dns logger
}

checkconfig() {
	if [ -z "${SERVERS}" ] ; then
		eerror "You need to set at least one http server to use in /etc/conf.d/htpdate"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting htpdate"
	htpdate ${HTPDATE_OPTS} ${PROXY} ${SERVERS}
	eend $?
}

stop() {
	ebegin "Stopping htpdate"
	start-stop-daemon --stop --quiet --pidfile /var/run/htpdate.pid
	eend $?
}