Hi

At 15:44 06.10.2003, Phuoc Nguen wrote:

Hi Erich,

can you give me a Example?
I'm absolute beginer...

One that looks pretty basic to me is /etc/init.d/ntpdate... This is used to run the ntpdate program once at system start. You can find it in the ntpdate.lrp package "tar tzf ntpdate.lrp etc/init.d/ntpdate" will show you the path to this file.

You will need some basic shell scripting knowledge to understand this.
----------------------------------------------------
#! /bin/sh

RCDLINKS="2,S51"

error () {
        echo "ntpdate error: $1"
        exit 1
}

test -f /usr/sbin/ntpdate || error "not found"
test -f /etc/default/ntp-servers || error "ntp-servers file not found"

. /etc/default/ntp-servers

test -n "$NTPSERVERS" || error "NTPSERVERS undefined"

case "$1" in
start|restart|force-reload)
  echo -n "Running ntpdate to synchronize clock"
  /usr/sbin/ntpdate -u -b -s $NTPSERVERS
  echo "."
  ;;
stop)
  ;;
*)
  echo "Usage: /etc/init.d/ntpdate {start|stop|restart|force-reload}"
  exit 1
esac

exit 0
------------------------------

HTH
Erich

THINK
Püntenstrasse 39
8143 Stallikon
mailto:[EMAIL PROTECTED]
PGP Fingerprint: BC9A 25BC 3954 3BC8 C024  8D8A B7D4 FF9D 05B8 0A16



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

Reply via email to