Skip to content

Instantly share code, notes, and snippets.

@spetersson
Created September 20, 2022 05:24
Show Gist options
  • Save spetersson/426bafba6355981eda44f248a9c15e77 to your computer and use it in GitHub Desktop.
Save spetersson/426bafba6355981eda44f248a9c15e77 to your computer and use it in GitHub Desktop.
# ifstated.conf
haproxy = '"rcctl check haproxy >/dev/null 2>&1" every 1'
state initial {
if $haproxy {
run "ifconfig vio1 up"
run "ifconfig vio2 up"
}
if ! $haproxy {
run "logger -st ifstated 'haproxy is down'"
set-state dead
}
}
state dead {
init {
run "ifconfig vio1 down"
run "ifconfig vio2 down"
}
if $haproxy {
run "logger -st ifstated 'haproxy is up'"
set-state initial
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment