13 lines
229 B
Plaintext
13 lines
229 B
Plaintext
|
#!/bin/bash
|
||
|
# Wrapper to execute any command in a specific
|
||
|
# network namespace.
|
||
|
# Usage:
|
||
|
# sonic-netns-exec <namespace name> <command to be executed>
|
||
|
NS="$1"
|
||
|
shift
|
||
|
if [ "$NS" != "" ]; then
|
||
|
ip netns exec $NS $@
|
||
|
else
|
||
|
$@
|
||
|
fi
|