summaryrefslogtreecommitdiff
blob: 25ac67dc52368c85d0fa3f13708b7b06d9a03c64 (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
#!/sbin/openrc-run
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
	before cron
	need net
	use dns
}

checkconfig() {
	if [ -z "${RDATE_SERVER}" ] ; then
		eerror "Please edit /etc/conf.d/rdate"
		eerror "I need to know what server to use!"
		return 1
	fi
	return 0
}

start() {
	checkconfig || return $?

	ebegin "Setting clock via rdate"
	/usr/bin/rdate -s ${RDATE_OPTS} -t ${RDATE_TIMEOUT} ${RDATE_SERVER} > /dev/null
	eend $? "Failed to set clock"
}