Optimization: use ip -n over ip netns exec

This saves an exec call.
This commit is contained in:
Demi Marie Obenour 2020-11-19 12:10:26 -05:00
parent 6517cca2a4
commit 097342bd08
No known key found for this signature in database
GPG Key ID: 28A45C93B0B5B6E0

View File

@ -35,7 +35,12 @@ function run
function netns
{
run ip netns exec "$netns" "$@"
if [[ "$1" = 'ip' ]]; then
shift
run ip -n "$netns" "$@"
else
run ip netns exec "$netns" "$@"
fi
}
run ip addr flush dev "$netns_appvm_if"