wiregate/peer_addall.sh
2023-11-10 02:03:18 +02:00

13 lines
375 B
Bash
Executable file

#!/bin/bash
ALLCLIENTS=/etc/wireguard/clients/*.info
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
for client in $ALLCLIENTS; do
peer=$(cat ${client} | grep '^peer=' | cut -d '=' -f 2)
email=$(cat ${client} | grep '^email=' | cut -d '=' -f 2)
echo "] peer_add.sh - peer: $peer - email: $email"
bash ${__dir}/peer_add.sh -p ${peer} -e ${email}
done