From owner-freebsd-questions Mon Jul 5 15:11:43 1999 Delivered-To: freebsd-questions@freebsd.org Received: from metis.host4u.net (metis.host4u.net [209.150.128.22]) by hub.freebsd.org (Postfix) with ESMTP id 485BA15159 for ; Mon, 5 Jul 1999 15:11:41 -0700 (PDT) (envelope-from dan.langille@dvl-software.com) Received: from wocker (210-55-152-24.ipnets.xtra.co.nz [210.55.152.24]) by metis.host4u.net (8.8.5/8.8.5) with SMTP id RAA09963; Mon, 5 Jul 1999 17:11:28 -0500 Message-Id: <199907052211.RAA09963@metis.host4u.net> From: "Dan Langille" Organization: DVL Software Limited To: Anton Berezin Date: Tue, 6 Jul 1999 10:11:28 +1200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: running frequent cron perl scripts Reply-To: dan.langille@dvl-software.com Cc: Burke Gallagher , freebsd-questions@FreeBSD.ORG In-reply-to: <19990705232139.D8704@lion.plab.ku.dk> References: <19990705203750.BEYX282564.mta1-rme@wocker>; from Dan Langille on Tue, Jul 06, 1999 at 08:34:27AM +1200 X-mailer: Pegasus Mail for Win32 (v3.01d) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 5 Jul 99, at 23:21, Anton Berezin wrote: > > ## set the following to the name of a program you want run if its a new > > ## IP > > $RunIfNew = "/home/dan/dns_update.sh"; > > Fine, unless you wish to do it in Perl, directly. It should not be > *that* difficult. Well, the above mentioned script (dns_update.sh) runs fine from the command line, but when launched from with perl, I get this email message: lynx: Can't access startfile http://www.yi.org/bin/dyndns.fcgi?ipaddr= Tue Jul 6 10:03:46 NZST 1999: Tue Jul 6 10:03:46 NZST 1999: Exiting via interrupt: 15 That script is provided by yi.org and I've modified it to include the full path to lynx after previous complaints from cron. $ cat dns_update.sh #!/bin/sh user_id="nottelling" password="secret" ip_addr=`netstat -rn | egrep ^0.0.0.0 | sed -e "s,.* ,,g" | \ xargs /sbin/ifconfig | grep "inet.addr" | sed -e "s,.*addr:,," \ -e "s, .*,,"` now=`date` /usr/local/bin/lynx -source -auth=$user_id:$password \ http://www.yi.org/bin/dyndns.fcgi?ipaddr=$ip_addr | \ sed -e "s,^,$now: ," -e "s,<.*\?>,,g" -- Dan Langille - DVL Software Limited The FreeBSD Diary - http://www.FreeBSDDiary.org/freebsd/ NZ FreeBSD User Group - http://www.nzfug.nz.freebsd.org/ The Racing System - http://www.racingsystem.com/racingsystem.htm To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message