pelibali wrote:
Hi,
I have a perl-script to modify the system-time of my laptop. While I was connected to my university's broadband, I could run this via cron once per day. Now I have only dial-up at my home, so really can't determine whether I will be online, when this script runs. I would pretty much modify the script e.g. just to avoid errors mailed to me, that first it should check that we are online (dialed-in) or not and do setting the time only in the first case. My first idea was to ping e.g. www.google.com or a similar always-on machine, but I didn't manage to interpret it.
ping -c1 www.google.com >/dev/null 2>&1 && ntpdate -w pool.ntp.org might do the job. As Per wrote, adding the ntpdate command to the dial-up script is better, if you dial-up with your laptop and not with a router. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com