mirror of
https://github.com/linuxserver/docker-wireguard
synced 2024-11-10 01:10:30 +00:00
21 lines
441 B
Plaintext
Executable File
21 lines
441 B
Plaintext
Executable File
#!/usr/bin/with-contenv bash
|
|
|
|
if [ ! $# -gt 0 ]; then
|
|
echo "You need to specify which peers to show"
|
|
exit 0
|
|
fi
|
|
|
|
for i in "$@"; do
|
|
if [[ "${i}" =~ ^[0-9]+$ ]]; then
|
|
PEER_ID="peer${i}"
|
|
else
|
|
PEER_ID="peer_${i//[^[:alnum:]_-]/}"
|
|
fi
|
|
|
|
if grep -q "# ${PEER_ID}" /config/wg0.conf; then
|
|
echo "PEER ${i} QR code:"
|
|
qrencode -t ansiutf8 < /config/${PEER_ID}/${PEER_ID}.conf
|
|
else
|
|
echo "PEER ${i} is not active"
|
|
fi
|
|
done |