diff options
Diffstat (limited to 'net-misc/rdate/files/rdate-initd-1.4-r2')
-rw-r--r-- | net-misc/rdate/files/rdate-initd-1.4-r2 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/net-misc/rdate/files/rdate-initd-1.4-r2 b/net-misc/rdate/files/rdate-initd-1.4-r2 new file mode 100644 index 000000000000..0805eadd9a3c --- /dev/null +++ b/net-misc/rdate/files/rdate-initd-1.4-r2 @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/rdate/files/rdate-initd-1.4-r2,v 1.1 2006/11/13 10:38:19 robbat2 Exp $ + +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} ${RDATE_SERVER} >/dev/null & + local pid=$! + (sleep ${RDATE_TIMEOUT:-30}; kill -9 ${pid} >&/dev/null) & + wait ${pid} + eend $? "Failed to set clock" +} |