File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 107
107
wait_timeout : " {{ infra_compose_wait_timeout }}"
108
108
register : deploy_wireguard_services_output
109
109
110
+ - name : Copy print-qr-codes util script into place
111
+ ansible.builtin.template :
112
+ src : print-qr-codes.sh.j2
113
+ dest : " {{ infra_wireguard_directory_path }}/print-qr-codes.sh"
114
+ owner : " {{ infra_wireguard_directory_owner }}"
115
+ group : " {{ infra_wireguard_directory_group }}"
116
+ mode : " 0750"
117
+
110
118
...
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # util to print QR codes for wireguard configs
4
+ # requires 'jq' and 'qrencode' to be installed
5
+
6
+ if ! command -v jq & > /dev/null; then
7
+ echo " Missing required package 'jq'"
8
+ exit 1
9
+ elif ! command -v qrencode & > /dev/null; then
10
+ echo " Missing required package 'qrencode'"
11
+ exit 1
12
+ fi
13
+
14
+ for wgcfg in $( docker volume inspect {{ infra_wireguard_volume_name_config }} | jq ' .[].Mountpoint' | sed ' s/"//g' ) /peer_* /peer_* .conf; do
15
+ echo $( basename " $wgcfg " )
16
+ qrencode -t ansiutf8 < " $wgcfg "
17
+ done
You can’t perform that action at this time.
0 commit comments