Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Feb 2004 14:47:25 -0600
From:      Nathan Kinkade <nkinkade@ub.edu.bz>
To:        Marwan Sultan <Admin@kifco.net>
Cc:        FreeBSD questions List <freebsd-questions@freebsd.org>
Subject:   Re: cron or ipfw problem!
Message-ID:  <20040220204725.GH68896@nkinkade.bmp.ub>
In-Reply-To: <20040220201619.M35470@kifco.net>
References:  <20040220201619.M35470@kifco.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040220204725.GH68896>