From ca402ae8409ae9eb1a8b679d46339b60f2df238d Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 4 Apr 2024 01:03:23 +0200 Subject: Sort the vpn-wireguard connectivity check output --- data.d/vpn-wireguard/hooks/post-up | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data.d/vpn-wireguard/hooks/post-up b/data.d/vpn-wireguard/hooks/post-up index b200922..edbcd50 100755 --- a/data.d/vpn-wireguard/hooks/post-up +++ b/data.d/vpn-wireguard/hooks/post-up @@ -3,6 +3,7 @@ readonly COLOR_RESET="\033[0m" readonly COLOR_OK="\033[32;1m" readonly COLOR_NOK="\033[31;1m" +readonly BUFFER="$(mktemp)" main() { printf "Verifying connectability...\n" @@ -15,6 +16,8 @@ main() { done < <(awk -F= '/vpn-wireguard.ipv(4|6)=/ { print $NF }' /etc/bashtard/hosts.d/*) wait + + sort -- "$BUFFER" >&2 } check() { @@ -38,7 +41,7 @@ log() { color="$COLOR_OK" fi - printf "%b%3s%b: %s\n" "$color" "$state" "$COLOR_RESET" "$addr" >&2 + printf "%b%3s%b: %s\n" "$color" "$state" "$COLOR_RESET" "$addr" >> "$BUFFER" } main "$@" -- cgit v1.1