diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 2211f6b..80813c6 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -36,6 +36,11 @@ case "$1" in /scripts/show-client.sh $2 exit 0 ;; + 'ls-configs') + cd /etc/wireguard + /scripts/ls-configs.sh + exit 0 + ;; *) echo "Starting wg-quick on $DEVICE" touch "${WG_LOG_FILE}" diff --git a/scripts/ls-configs.sh b/scripts/ls-configs.sh new file mode 100755 index 0000000..bd7ac89 --- /dev/null +++ b/scripts/ls-configs.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +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/"