@@ -23,15 +23,15 @@ systemd-booted() {
23
23
24
24
usage () {
25
25
cat << EOF
26
- Usage: $0 [-fhst ] [-d descr] [-e <endpoint>] [-i <name >] [-p pubkey ]
27
- [ip-addr] [port (with -s)]
26
+ Usage: $0 [-fhs ] [-d < descr> ] [-e <endpoint>] [-i <ifname >] [-o <file> ]
27
+ [-p <pubkey>] [-t <type>] [ ip-addr] [port (with -s)]
28
28
29
29
-b,--backend=<backend> Backend to configure (networkd, wg-quick or auto (default))
30
30
-d,--descr=<description> Description for .netdev (default: WireGuard VPN)
31
31
-e,--endpoint=<endpoint> WireGuard endpoint of the Server
32
32
-f,--force overwrite existing files
33
33
-h,--help Show this usage text
34
- -i,--iface =<ifname> name of the WireGuard interface to create (default: wg0)
34
+ -i,--ifname =<ifname> name of the WireGuard interface to create (default: wg0)
35
35
-o,--out-file=<file> File mode: don't configure interface, write configuration to
36
36
given file (- for stdout). For networkd files, either .netdev
37
37
or .network can be provided and both will be created.
103
103
command -v wg > /dev/null || error " wg not found. Please install wireguard-tools first!"
104
104
105
105
opts=d:e:fhi:o:p:st:
106
- lopts=descr:,endpoint:,force,help,iface:,out-file:,pubkey:,server,type:
106
+ lopts=descr:,endpoint:,force,help,iface:,ifname:, out-file:,pubkey:,server,type:
107
107
parsed_opts=$( getopt -o $opts -l $lopts -n " $0 " -- " $@ " )
108
108
eval set -- " $parsed_opts "
109
109
@@ -141,7 +141,12 @@ while [[ "$1" != "--" ]]; do
141
141
-h|--help)
142
142
usage
143
143
;;
144
- -i|--iface)
144
+ -i|--ifname)
145
+ wg_ifname=" $2 "
146
+ shift 2
147
+ ;;
148
+ --iface)
149
+ echo " Warning: --iface is deprecated, use --ifname" >&2
145
150
wg_ifname=" $2 "
146
151
shift 2
147
152
;;
0 commit comments