From owner-freebsd-questions@FreeBSD.ORG Fri Feb 20 12:51:37 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 165D916A4CE for ; Fri, 20 Feb 2004 12:51:37 -0800 (PST) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE65943D1F for ; Fri, 20 Feb 2004 12:51:36 -0800 (PST) (envelope-from nkinkade@fastmail.fm) X-Sasl-enc: YY9HKU93mbNmw2kvMsIUDw 1077310065 Received: from [206.26.199.146] (unknown [206.27.244.214]) by www.fastmail.fm (Postfix) with ESMTP id 320D65AABF4; Fri, 20 Feb 2004 15:47:44 -0500 (EST) Received: from nkinkade by [206.26.199.146] with local (Exim 4.12) id 1AuHYT-000Pt1-00; Fri, 20 Feb 2004 14:47:25 -0600 Date: Fri, 20 Feb 2004 14:47:25 -0600 From: Nathan Kinkade To: Marwan Sultan Message-ID: <20040220204725.GH68896@nkinkade.bmp.ub> Mail-Followup-To: Marwan Sultan , FreeBSD questions List References: <20040220201619.M35470@kifco.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SVeEiVwWO9F1slJ8" Content-Disposition: inline In-Reply-To: <20040220201619.M35470@kifco.net> User-Agent: Mutt/1.4.1i Sender: Nathan Kinkade cc: FreeBSD questions List Subject: Re: cron or ipfw problem! X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nathan Kinkade List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 20:51:37 -0000 --SVeEiVwWO9F1slJ8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 20, 2004 at 11:33:45PM +0300, Marwan Sultan wrote: > Hello bsd, >=20 > I have FreeBSD 4.8R, NATd, ipfw enabled. >=20 > I want to add a rule to ipfw which activate from 3AM to 3PM : says: > ipfw 05000 add deny all from 192.168.1.21 to any >=20 > So I created a shell script lets say deny.sh says the above rule and > I chmod +x the script. > =20 > Second shell script lets say enable.sh to delete this ipfw which sure > says ipfw delete 05000 >=20 > So in this case I have to shell scripts one will Activate the > ipfw rule (add) and will deactivate it (delete). >=20 > How to run the scripts? thro crontab I fixed my crontab to=20 > 0 3 * * * /path/deny.sh > 0 15 * * * /path/enable.sh >=20 > Am i doing something wrong? is it a stupid thing? >=20 > The crontab runs at the schedualed times and I can see in /var/log/cron > /usr/sbin/cron[18525]: (root) CMD (/path/deny.sh) >=20 > But the ipfw will not be added! why? the email log says: ipfw: not found >=20 > why? is it a crontab mistake? shell script mistake? ipfw? >=20 > I tried many many other commands in the shell script such as mkdir, > rm-rf whatever.. all works, except this ipfw? >=20 > Any advise? Help? better ideas? >=20 > Thank you > -- > Marwan Sultan It would be useful to see the contents of the script. Two things come to mind: 1) Did you specificy the full path to ipfw in your script? 2) Just to be sure, is the cron job in root's crontab, or possibly a regular users? Nathan --=20 gpg --keyserver pgp.mit.edu --recv-keys D8527E49 --SVeEiVwWO9F1slJ8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQFANnJdO0ZIEthSfkkRAhg0AJ99kUxV77cna/fJwxPq5CB8os5jKwCdGINn ZOLhF3BxEONb7oi52lZImPs= =jWQQ -----END PGP SIGNATURE----- --SVeEiVwWO9F1slJ8--