From 2320ac3349789551e9c7500dba03e04b9ac02f41 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 10 Jun 2022 12:32:42 +1000 Subject: Don't abbreviate ip(8) arguments in examples and tests ip(8)'s ability to take abbreviated arguments (e.g. "li sh" instead of "link show") is very handy when using it interactively, but it doesn't make for very readable scripts and examples when shown that way. Signed-off-by: David Gibson --- doc/demo.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/demo.sh b/doc/demo.sh index 87fad1c..f49110a 100755 --- a/doc/demo.sh +++ b/doc/demo.sh @@ -19,9 +19,9 @@ get_token() { unset IFS } -ipv6_dev() { get_token "dev" $(ip -o -6 ro show default | grep via); } -ipv6_devaddr() { get_token "inet6" $(ip -o -6 ad sh dev "${1}" scope global); } -ipv6_ll_addr() { get_token "inet6" $(ip -o -6 ad sh dev "${1}" scope link); } +ipv6_dev() { get_token "dev" $(ip -o -6 route show default | grep via); } +ipv6_devaddr() { get_token "inet6" $(ip -o -6 addr show dev "${1}" scope global); } +ipv6_ll_addr() { get_token "inet6" $(ip -o -6 addr show dev "${1}" scope link); } ipv6_mask() { echo ${1#*/}; } ipv6_mangle() { IFS=':' @@ -93,7 +93,7 @@ if [ -n "${ipv6_addr}" ]; then ip addr add "${ipv6_addr}" dev "veth_${ns}" ip route add "${ipv6_passt}" dev "veth_${ns}" passt_ll="$(ipv6_ll_addr "veth_${ns}")" - main_ll="$(get_token "link/ether" $(ip -o li sh "veth_${ns}"))" + main_ll="$(get_token "link/ether" $(ip -o link show "veth_${ns}"))" ip neigh add "${passt_ll%%/*}" dev "veth_${ns}" lladdr "${main_ll}" ip -n "${ns}" route add default via "${passt_ll%%/*}" dev "veth_${ns}" -- cgit v1.2.3