Remove generation of PNG QR codes on init

This commit is contained in:
Paul-Christian Volkmer 2022-12-15 20:35:12 +01:00
parent 8ec3461314
commit 0aa12e997f
3 changed files with 3 additions and 10 deletions

View File

@ -48,7 +48,7 @@ wg_1 | - Using port 51820
wg_1 | - Using network 192.168.42.0/24
wg_1 | - Using default MTU
wg_1 | - Forward all traffic
wg_1 | - Generating 5 client configs and client QR codes
wg_1 | - Generating 5 client configs
wireguard_wg_1 exited with code 0
```

View File

@ -45,7 +45,7 @@ fi
if (( $CLIENTS > 240 )); then
CLIENTS=240
fi
echo " - Generating $CLIENTS client configs and client QR codes"
echo " - Generating $CLIENTS client configs"
SERVER_SEC_KEY=$(wg genkey)
SERVER_PUB_KEY=$(echo $SERVER_SEC_KEY | wg pubkey)
@ -127,10 +127,3 @@ Endpoint = $SERVER_HOST:$SERVER_PORT
EOF
done
# Create QR-codes for clients
if [ ! -z "$(which qrencode 2>/dev/null)" ]; then
for (( i=1; i<=$CLIENTS; i++ )); do
qrencode -t png -o "$DEVICE-client_$i.png" < $DEVICE-client_$i.conf
done
fi

View File

@ -50,7 +50,7 @@ case "$1" in
;;
'purge')
cd /etc/wireguard
rm *.conf *.png 2>/dev/null
rm *.conf 2>/dev/null
echo "Removed all configuration files"
exit 0
;;