From 1e5d1088c3b0aa67c6a92dea8cbdcb58c96b9902 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Sat, 31 Dec 2022 21:32:37 +0100 Subject: [PATCH] Show public keys running configuration list command --- scripts/ls-configs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ls-configs.sh b/scripts/ls-configs.sh index c17d9b6..6c6d992 100755 --- a/scripts/ls-configs.sh +++ b/scripts/ls-configs.sh @@ -8,4 +8,6 @@ fi echo "Configurations - sorted by creation date" echo echo "Server" -cat "$DEVICE.conf" | grep -e "# Client" -e "# <-" | grep -a "#" | sed "s/# //" | sed "s/<- //" | sed "s/\(.*\)\([0-9]\{4\}\)/Created: \1\2\n/" +echo -n "PublicKey: " +cat "$DEVICE.conf" | grep "PrivateKey =" | sed "s/PrivateKey = // " | wg pubkey +cat "$DEVICE.conf" | grep -e "# Client" -e "PublicKey =" -e "# <-" | grep -a "" | sed "s/# //" | sed "s/ = /: / " | sed "s/<- //" | sed "s/\(.*\)\([0-9]\{4\}\)/Created: \1\2\n/"