Skip to content

Commit e012d0b

Browse files
committed
Cleanup help, deprecate --iface
1 parent ea760f8 commit e012d0b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

wg-setup-client

+10-5
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ systemd-booted() {
2323

2424
usage() {
2525
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)]
2828
2929
-b,--backend=<backend> Backend to configure (networkd, wg-quick or auto (default))
3030
-d,--descr=<description> Description for .netdev (default: WireGuard VPN)
3131
-e,--endpoint=<endpoint> WireGuard endpoint of the Server
3232
-f,--force overwrite existing files
3333
-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)
3535
-o,--out-file=<file> File mode: don't configure interface, write configuration to
3636
given file (- for stdout). For networkd files, either .netdev
3737
or .network can be provided and both will be created.
@@ -103,7 +103,7 @@ EOF
103103
command -v wg >/dev/null || error "wg not found. Please install wireguard-tools first!"
104104

105105
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:
107107
parsed_opts=$(getopt -o $opts -l $lopts -n "$0" -- "$@")
108108
eval set -- "$parsed_opts"
109109

@@ -141,7 +141,12 @@ while [[ "$1" != "--" ]]; do
141141
-h|--help)
142142
usage
143143
;;
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
145150
wg_ifname="$2"
146151
shift 2
147152
;;

0 commit comments

Comments
 (0)