cron or ipfw problem!
Marwan Sultan
Admin at kifco.net
Fri Feb 20 12:33:38 PST 2004
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
More information about the freebsd-questions
mailing list