From 38a9a3e0dc9713af7509e455ca9a71567d80323f Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Tue, 18 Jan 2022 17:39:53 +0100 Subject: [PATCH] wg-installer: cosmetic changes Use "ip addr" instead of "ip addres" or "ip a". Signed-off-by: Nick Hainke --- net/wg-installer/common/wg.sh | 2 +- net/wg-installer/wg-client/wg-client-installer.sh | 4 ++-- net/wg-installer/wg-server/lib/wg_functions.sh | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/wg-installer/common/wg.sh b/net/wg-installer/common/wg.sh index b4f884dce5..610c26bb71 100644 --- a/net/wg-installer/common/wg.sh +++ b/net/wg-installer/common/wg.sh @@ -29,7 +29,7 @@ check_wg_neighbors() { wg_interfaces=$(ip link | grep wg | awk '{print $2}' | sed 's/://') for phy in $wg_interfaces; do - linklocal=$(ip -6 a list dev $phy | grep "scope link" | awk '{print $2}' | sed 's/\/64//') 2>/dev/null + linklocal=$(ip -6 addr list dev $phy | grep "scope link" | awk '{print $2}' | sed 's/\/64//') 2>/dev/null ips=$(ping ff02::1%$phy -w5 -W5 -c10 | awk '/from/{print($4)}' | sed 's/.$//') 2>/dev/null delete=1 for ip in $ips; do diff --git a/net/wg-installer/wg-client/wg-client-installer.sh b/net/wg-installer/wg-client/wg-client-installer.sh index 28fdf6a85c..b1bbdaeb3b 100644 --- a/net/wg-installer/wg-client/wg-client-installer.sh +++ b/net/wg-installer/wg-client/wg-client-installer.sh @@ -86,8 +86,8 @@ register_client_interface () { ip link add dev $ifname type wireguard - ip -6 a a dev $ifname $client_ip - ip -6 a a dev $ifname fe80::2/64 + ip -6 addr add dev $ifname $client_ip + ip -6 addr add dev $ifname fe80::2/64 wg set $ifname listen-port $port private-key $privkey peer $pubkey allowed-ips 0.0.0.0/0,::0/0 endpoint "${endpoint}:${gw_port}" ip link set up dev $ifname ip link set mtu $mtu_client dev $ifname # configure mtu here! diff --git a/net/wg-installer/wg-server/lib/wg_functions.sh b/net/wg-installer/wg-server/lib/wg_functions.sh index 035e4e6f0f..ec4aaa032f 100644 --- a/net/wg-installer/wg-server/lib/wg_functions.sh +++ b/net/wg-installer/wg-server/lib/wg_functions.sh @@ -65,14 +65,14 @@ wg_register () { # create wg tunnel ip link add dev $ifname type wireguard wg set $ifname listen-port $port private-key $gw_key peer $public_key allowed-ips 0.0.0.0/0,::0/0 - ip -6 address add $gw_ip_assign dev $ifname - ip -6 address add fe80::1/64 dev $ifname + ip -6 addr add $gw_ip_assign dev $ifname + ip -6 addr add fe80::1/64 dev $ifname v4prefix=$(uci get wgserver.@server[0].base_v4prefix) if [ $? -eq 0 ]; then gw_ipv4=$(owipcalc $v4prefix add $offset next 32) # gateway ip gw_ipv4_assign="${gw_ipv4}/32" - ip address add $gw_ipv4_assign broadcast 255.255.255.255 dev $ifname + ip addr add $gw_ipv4_assign broadcast 255.255.255.255 dev $ifname fi ip link set up dev $ifname -- 2.30.2