Created
September 20, 2022 05:24
-
-
Save spetersson/426bafba6355981eda44f248a9c15e77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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