This allows arbitrary commands to be passed into the NS_EXEC macro to be
executed within a namespace, including commands that have quotes and
commands chained together.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
#
# Execute 'command' in 'namespace'
m4_define([NS_EXEC],
- [ip netns exec $1 bash -c "$2"]
-)
+ [ip netns exec $1 sh << NS_EXEC_HEREDOC
+$2
+NS_EXEC_HEREDOC])
# NS_CHECK_EXEC([namespace], [command], other_params...)
#