summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdata.d/vpn-wireguard/hooks/post-up5
1 files changed, 4 insertions, 1 deletions
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 "$@"