From owner-freebsd-questions@FreeBSD.ORG Fri Feb 20 12:33:38 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 10F5616A4CE for ; Fri, 20 Feb 2004 12:33:38 -0800 (PST) Received: from kifco.net (host4.kifco.net [216.65.57.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08C5443D1D for ; Fri, 20 Feb 2004 12:33:38 -0800 (PST) (envelope-from Admin@kifco.net) Received: from kifco.net (deadline@localhost [127.0.0.1]) by kifco.net (8.12.8p1/8.12.8) with ESMTP id i1KKXjqQ066839 for ; Fri, 20 Feb 2004 20:33:45 GMT (envelope-from Admin@kifco.net) From: "Marwan Sultan" To: "FreeBSD questions List" Date: Fri, 20 Feb 2004 23:33:45 +0300 Message-Id: <20040220201619.M35470@kifco.net> X-Mailer: Open WebMail X-OriginatingIP: 62.150.175.140 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Subject: cron or ipfw problem! X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 20:33:38 -0000 Hello bsd, I have FreeBSD 4.8R, NATd, ipfw enabled. 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 So I created a shell script lets say deny.sh says the above rule and I chmod +x the script. Second shell script lets say enable.sh to delete this ipfw which sure says ipfw delete 05000 So in this case I have to shell scripts one will Activate the ipfw rule (add) and will deactivate it (delete). How to run the scripts? thro crontab I fixed my crontab to 0 3 * * * /path/deny.sh 0 15 * * * /path/enable.sh Am i doing something wrong? is it a stupid thing? The crontab runs at the schedualed times and I can see in /var/log/cron /usr/sbin/cron[18525]: (root) CMD (/path/deny.sh) But the ipfw will not be added! why? the email log says: ipfw: not found why? is it a crontab mistake? shell script mistake? ipfw? I tried many many other commands in the shell script such as mkdir, rm-rf whatever.. all works, except this ipfw? Any advise? Help? better ideas? Thank you -- Marwan Sultan