mirror of
https://github.com/linuxserver/docker-wireguard
synced 2024-11-06 09:20:26 +00:00
18 lines
466 B
Plaintext
Executable File
18 lines
466 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
|
|
|
|
INTERNAL_SUBNET=${INTERNAL_SUBNET:-10.13.13.0}
|
|
INTERFACE=$(echo "$INTERNAL_SUBNET" | awk 'BEGIN{FS=OFS="."} NF--')
|
|
|
|
for i in "$@"; do
|
|
if grep -q "AllowedIPs = ${INTERFACE}.$(( $i + 1 ))/32" /config/wg0.conf; then
|
|
echo "PEER $i QR code:"
|
|
qrencode -t ansiutf8 < /config/peer${i}/peer${i}.conf
|
|
else
|
|
echo "PEER $i is not active"
|
|
fi
|
|
done |