Show public keys running configuration list command

This commit is contained in:
Paul-Christian Volkmer 2022-12-31 21:32:37 +01:00
parent 2fe5f14383
commit 1e5d1088c3

View File

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