[Firehol-support] Restarting firehol from cron?

Rui Bernardo rui.bernardo.pt at gmail.com
Sat Sep 8 10:03:01 BST 2007


Hi, 

I have search the forum and the mailing list and didn't find what I
want.

I have a dhcp internet connection via cable modem. On firehol.conf, when
the computer boots, I've set a variable that gets the current IP with :

ADDRESS=`/sbin/ifconfig eth0 | egrep 'inet' | cut -d ':' -f 2 | cut -d
'P' -f 1 | cut -d 'B' -f 1`

and on my net interface I've something like this:

interface eth0 internet src not "${UNROUTABLE_IPS} ${PRIVATE_IPS}
$PRIVATE_NETWORK" dst $ADDRESS

As my ISP changes my IP from time to time, I've made a script that runs
on cron each 5 minutes to find if my IP have changed. The objective here
is to restart firehol when my IP changes.

Now, when I run on the console 

# /etc/init.d/firehol restart

if the rules have changed, firehol asks me to write "commit" on the
console so the new rules are commited.

My question is: can I run "/etc/init.d/firehol restart" from the script
that checks the IP on cron? Will Firerhol ask to write "commit"?? How
can I restart Firehol from a script?

Thanks for Firehol, it's really simple to use, and thanks for any
answer. Sorry if this is a dum question.





More information about the Firehol-support mailing list