[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [debian-knoppix] ntpdate at start up?



On 05/05/04 07:29, lists1 wrote:

how can I set knoppix to run ntpdate at start up?  Where do I put the file?

This is how I fix the date and time with Knoppix 3.3, running from a copy of the CD on the hard drive. This script works well if you have a slow modem dialup link and will also crash the timezone to your location. Edit as required for your locale.

1) You can put this script either into /etc/network so it runs when ppp
comes up if your computer connects directly to the internet, or in /etc/init.d/ and invoke it from /etc/inittab and /etc/init.d/localrc if your computer is on a LAN behind a router or firewall.

knx-clock
#!/bin/bash

rm /etc/localtime
cp /usr/share/zoneinfo/Pacific/Auckland /etc/localtime
echo 'Pacific/Auckland' >/etc/timezone
echo "ntpdate not run on boot" > /root/clockset.txt
status=0
count=0
timeservers=$(cat /etc/default/ntp-servers)
until [ $status -eq 1 ] || [ $count -eq 3 ]
do
  ntpdate -but 5 $timeservers && status=1
  count="$((count + 1))"
done 2>&1 |tee /root/clockset.txt

2) Edit /etc/default/ntp-servers to add your ISPs ntp servers.

3) KNOPPIX - Configure - Save KNOPPIX Configuration, then reboot.

Rgds
John



_______________________________________________
debian-knoppix mailing list
debian-knoppix@linuxtag.org
http://mailman.linuxtag.org/mailman/listinfo/debian-knoppix


Reply to: