News: This forum is now permanently frozen.
Pages: [1]
Topic: Enable / Disable Rule Programatically  (Read 1265 times)
« on: January 22, 2010, 00:27:00 »
roosterdude *
Posts: 14

Hi All,

I have a need to enable or disable a firewall rule on an interface programatically.

Initially i'd looked at doing an authenticated http get on...

http://x.x.x.x/firewall_rules.php?if=wan&act=toggle&id=0

...to toggle the first rule on the wan interface.  However once I have done that I need to do a POST request to effectively click the "Apply Changes" button.

So I'm wondering if this is the only way of doing this or am I missing a more elegant way of enabling / disabling a firewall rule from code?

Thanks in Advance :-)
« Reply #1 on: January 22, 2010, 00:51:02 »
Fred Grayson *****
Posts: 994

wget can be used to do button pushes with a command like this:

--post-data=submit=

Have you tried that?

--
Google is your friend and Bob's your uncle.
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines