# Program to run in the new network namespace:
XCMD1=xterm
+XCMD1_ARGS=
# Virtual Ethernet to connect new network namespace to default namespace:
VETH_HOST=veth_host
###############################
-set -x
+#set -x
SHORTNAME=${0##*/}
exit 1
fi
+# Locate user provided command:
if [ -n "XCMD1" ] ; then
XCMD=$(command -v $XCMD1)
if [ -z $XCMD ] ; then
- echo "please install the $XCMD1 package"
+ echo "command not found: $XCMD1"
exit 1
fi
fi
# Run the configured command, if any, inside the namespace:
if [ -n "$XCMD" ] ; then
- $IP netns exec $1 su -p -c "$XCMD" $SUDO_USER &
+ $IP netns exec $1 su -p -c "$XCMD $XCMD1_ARGS" $SUDO_USER &
$IP netns exec $1 echo "$!" > "$RUNDIR/xcmd_.pid"
fi
}