pfSense Support Subscription

Author Topic: Building shell scripts  (Read 1706 times)

0 Members and 1 Guest are viewing this topic.

Offline ekses_dinajd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Building shell scripts
« on: February 18, 2009, 03:14:35 pm »
Hi!

Does anyone know how to create your own shell script that for example change the rule value from enabled to disabled?? I would like to trigger that script when some ip (for example ip of my gateway) is not available any more, and for result of that i would like to have some rule being disabled so the next rule in order will take place..
I've tried failover methods, but not get them worked, so i would like to try do that manually...

anyone with this kind of knowledge?

Thx!

Offline cmb

  • Administrator
  • Hero Member
  • *****
  • Posts: 6314
    • LinkedIn
    • Twitter
    • View Profile
    • Chris Buechler
Re: Building shell scripts
« Reply #1 on: February 18, 2009, 08:55:15 pm »
I know people have done things of this nature using curl, might search the forum on that to find more info.

Offline tikid

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Building shell scripts
« Reply #2 on: May 02, 2009, 09:48:29 pm »
Use a php script with the -q argument when calling the interpreter.  Include the config.inc file, and set the variable to whatever you need it to be.  It will reset to the stored value when the router reboots.  The current value will be written to the config if you save any settings.