cron or ipfw problem!
Nathan Kinkade
nkinkade at ub.edu.bz
Fri Feb 20 12:51:37 PST 2004
On Fri, Feb 20, 2004 at 11:33:45PM +0300, Marwan Sultan wrote:
> 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
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
--
gpg --keyserver pgp.mit.edu --recv-keys D8527E49
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040220/3fce3ebe/attachment.bin
More information about the freebsd-questions
mailing list