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/"