* pelibali <pelibali@freemail.hu> [01-25-05 15:35]:
Concerning the same topic I still would have a (for me) too advanced question: how to automatize that? I mean half-automatically, when I'm online through my dial-up (I use Kinternet to connect); or I ride our LAN, how to setup the script you corrected to run_once_ after the connection was made, or the net-cable was attached?!
here is a perl script written for isdn, but dialup works the same: edited /etc/ppp/ip-up.local to #!/usr/bin/perl $max_diff = 86400; $touchfile = "/tmp/ntp-update"; $t_diff = $max_diff; $now = time; if( -e $touchfile ){ my @fileinfo = stat $touchfile; $t_diff = $now - $fileinfo[9]; } if( $t_diff ge $max_diff ){ system( "/usr/sbin/ntpdate ntp.fully.qualified.domain.name" ); system( "touch $touchfile" ); } this will correct the time once a day when connecting. disclaimer: I did not write the script, do not know perl. Someone else more knowledgable may offer a better solution. another that updated the clock every time I got online when I was on dial-up #!/bin/bash sleep 15 until host <your isp name>; do # check for connect & sleep 3 # wait until confirm done sudo /usr/sbin/ntpdate <ntp.server> fetchmail -d 600 exit -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos