1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/sh
#
# $XORP: xorp/fea/command_mfea,v 1.3 2003/10/15 19:07:35 pavlin Exp $
#
#
# Send commands to a running MFEA process.
#
MODULE_NAME="MFEA"
HOSTNAME=`hostname`
echo "Sending command to $MODULE_NAME on $HOSTNAME..."
# Conditionally set ${srcdir} if it wasn't assigned (e.g., by `gmake check`)
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
#
# The optional first argument should be either -4 or -6 to specify
# IPv4 or IPv6 command
#
# The next argument should be the command to call.
# The rest of the arguments should be the arguments to the command to call.
#
usage()
{
echo "Usage: $0 [-4 | -6 ] <xrl_command> [xrl_command_arguments ... ]"
}
if [ $# -lt 1 ] ; then
usage;
exit 1
fi
case "${1}" in
-4)
if [ $# -lt 2 ] ; then
usage;
exit 1
fi
IP_VERSION=IPV4
shift
;;
-6)
if [ $# -lt 2 ] ; then
usage;
exit 1
fi
IP_VERSION=IPV6
shift
;;
*)
# XXX: IP version defaults to IPv4
IP_VERSION=IPV4
;;
esac
. ${srcdir}/../cli/xrl_cli_shell_funcs.sh
. ${srcdir}/../fea/xrl_mfea_shell_funcs.sh
$*
exit $?
|