Skip to content

Commit 0e243ad

Browse files
authored
Update wireguard-install.sh
added qr code save as a png for new clients and rm in case of revoke
1 parent 95f0d4f commit 0e243ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wireguard-install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ AllowedIPs = ${CLIENT_WG_IPV4}/32,${CLIENT_WG_IPV6}/128" >>"/etc/wireguard/${SER
419419
if command -v qrencode &>/dev/null; then
420420
echo -e "${GREEN}\nHere is your client config file as a QR Code:\n${NC}"
421421
qrencode -t ansiutf8 -l L <"${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
422+
qrencode -o "${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.png" -l L <"${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
422423
echo ""
423424
fi
424425
@@ -464,6 +465,7 @@ function revokeClient() {
464465
# remove generated client file
465466
HOME_DIR=$(getHomeDirForClient "${CLIENT_NAME}")
466467
rm -f "${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.conf"
468+
rm -f "${HOME_DIR}/${SERVER_WG_NIC}-client-${CLIENT_NAME}.png"
467469
468470
# restart wireguard to apply changes
469471
wg syncconf "${SERVER_WG_NIC}" <(wg-quick strip "${SERVER_WG_NIC}")

0 commit comments

Comments
 (0)