From db2e4bdfd532e556eb5bb47fcf2d19b6911a408a Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Tue, 2 Aug 2022 17:08:05 -0700 Subject: [PATCH] add wg-client-list.sh --- wg-client-list.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 wg-client-list.sh diff --git a/wg-client-list.sh b/wg-client-list.sh new file mode 100755 index 0000000..bd8eba4 --- /dev/null +++ b/wg-client-list.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# vpn-stack +# A set of bash scripts for installing and managing a WireGuard VPN server. +# https://git.stack-source.com/msb/vpn-stack +# Copyright (c) 2022 Matthew Saunders Brown +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# +# wg-client-list.sh +# list all client configs available on the server + +# require root +if [ "${EUID}" -ne 0 ]; then + echo "This script must be run as root" + exit 1 +fi + +# prints a table with username & device split in to columns +(echo "Client.Config" && echo "--------.------" && cd /etc/wireguard/clients/ && ls -1 *.conf)|sed 's|\.conf$||g'|sed 's|\.| |g'|column -t