Date: Sat, 15 May 2010 08:44:32 +0200 From: Polytropon <freebsd@edvax.de> To: umage <theultramage@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: ipfw natd rules not loading on startup Message-ID: <20100515084432.36a8812f.freebsd@edvax.de> In-Reply-To: <4BEDEBC6.5000505@gmail.com> References: <4BEDEBC6.5000505@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Just a sidenote:
On Sat, 15 May 2010 02:33:10 +0200, umage <theultramage@gmail.com> wrote:
> However, if I
> run the script manually, or call it from the end of /etc/rc, it will add
> these rules as well. Currently I am using a workaround.
It's not a good idea to modify /etc/rc. In your case, using the
mechanism s of /etc/rc(.shutdown).local is a good way to call
scripts that do not fit the rc.d concept. See "man rc.local"
for details.
So I would suggest something for /etc/rc.local like this:
#!/bin/sh
if [ -z "${source_rc_confs_defined}" ]; then
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
source_rc_confs
elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
elif [ -r /etc/rc.conf.local ]; then
. /etc/rc.conf.local
fi
fi
echo -n " custom-firewall"
/your/firewall/script.sh --here
The final dot + newline in the messages will be added by rc,
if I remember correctly.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100515084432.36a8812f.freebsd>
