# Simple ifstated config file. Assumes at least one carp interface # (carp0). When ifstated starts up, it'll switch to the proper state # depending on whether or not your host is the current carp master. When # it hops between states, it'll email you and tell you. # # Warning, if things really go south, you may get barraged with emails as # the carp master and slave bounce back and forth. Be careful! init-state auto wan_carp_up = "carp0.link.up" wan_carp_init = "carp0.link.unknown" state auto { if ($wan_carp_init) run "sleep 5" if ($wan_carp_up) set-state wan_master if (! $wan_carp_up) set-state wan_slave } state wan_master { init { run "echo WAN master at `date` | mail -s 'WAN master change' jhart@spoofed.org" } if ($wan_carp_init) run "sleep 2" if (! $wan_carp_up) set-state wan_slave } state wan_slave { init { run "echo WAN slave at `date` | mail -s 'WAN slave change' jhart@spoofed.org" } if ($wan_carp_init) run "sleep 2" if ($wan_carp_up) set-state wan_master }