Add a script to get the IP of a client
This commit is contained in:
parent
7e4c7e8f9e
commit
ad05ea8c73
11
scripts/wg-get-client-ip
Executable file
11
scripts/wg-get-client-ip
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# We need 1 argument
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <pubkey>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# NOTE: The final `grep` call is needed to make this fail if the pubkey is not found
|
||||||
|
sudo wg show all dump | grep $1 | cut -f 4 | cut -d: -f1 | grep ""
|
Loading…
x
Reference in New Issue
Block a user