diff options
author | ekhudiyev <88712424+ekhudiyev@users.noreply.github.com> | 2021-12-13 14:38:19 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 14:38:19 +0400 |
commit | aadb42cc9cb6a2d999260c6fcafe8647950d9de3 (patch) | |
tree | e0cf22dd9d6df890d3f70c72cc5cf3a4cf4508cd /docs | |
parent | 89decd0d67ac78a0f874aed22aa364409c75b80e (diff) | |
download | vyos-documentation-aadb42cc9cb6a2d999260c6fcafe8647950d9de3.tar.gz vyos-documentation-aadb42cc9cb6a2d999260c6fcafe8647950d9de3.zip |
Updated document with health-check script example.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/configexamples/dual-hub-dmvpn.rst | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/docs/configexamples/dual-hub-dmvpn.rst b/docs/configexamples/dual-hub-dmvpn.rst index ea4d69f7..8659a896 100644 --- a/docs/configexamples/dual-hub-dmvpn.rst +++ b/docs/configexamples/dual-hub-dmvpn.rst @@ -162,7 +162,22 @@ _________________________________________ .. code-block:: none - TBC + #!/bin/bash + + eth0status="$(cat /sys/class/net/eth0/operstate | grep 'up')" + + if [[ ! -z ${eth0status} ]]; then + eth0gw="$(ip -j r show 0.0.0.0/0 dev eth0 | awk 'match($0, /\"gateway":\"([[:digit:]\.]+)/, gw) {print gw[1]}')" + if [[ ! -z $eth0gw ]]; then + /bin/ping -I eth0 -c 1 -W 1 $eth0gw && exit 0 || exit 1 + else + exit 1 + fi + else + #Exit 0 because eth0 down is handled by vrrp transition + exit 0 + fi + **Note**: some parts of the script might be dependent on your network topology and connectivity. Be careful before using it on your own devices. |