Commit 5fda5134 authored by Joanne Hugé's avatar Joanne Hugé

Cleanup and improve run_client script

parent b01a7fef
...@@ -3,24 +3,34 @@ ...@@ -3,24 +3,34 @@
script_dir=$(dirname $(realpath $0)) script_dir=$(dirname $(realpath $0))
usage() { usage() {
echo "Usage: $0 -e delta|-p [-i INTERVAL]" 1>&2; echo "Usage: $0 -e delta|-p [-i INTERVAL] [-t]" 1>&2;
exit 1; exit 1;
} }
# Default interval # Default interval
interval=100000 interval=100000
while getopts "e:i:p" opt; do # Default options
client_options="-a -p 99 -f eth0"
qdisc_options=""
while getopts "e:i:pt" opt; do
case "${opt}" in case "${opt}" in
e ) e )
delta=${OPTARG}
use_etf=1 use_etf=1
client_options+=" -e -q 7"
qdisc_options+="-e ${OPTARG}"
;; ;;
i ) i )
interval=${OPTARG} interval=${OPTARG}
;; ;;
p ) p )
use_pfast=1 use_pfast=1
client_options+=" -q 1"
qdisc_options+="-p"
;;
t )
client_options+=" -t"
;; ;;
* ) * )
usage usage
...@@ -36,14 +46,8 @@ if [ -n "${use_etf}" ] && [ -n "${use_pfast}" ]; then ...@@ -36,14 +46,8 @@ if [ -n "${use_etf}" ] && [ -n "${use_pfast}" ]; then
usage usage
fi fi
if [ -n "${use_etf}" ]; then echo "$script_dir/create_qdisc $qdisc_options";
echo "$script_dir/create_qdisc -e $delta"; $script_dir/create_qdisc $qdisc_options;
$script_dir/create_qdisc -e $delta;
echo "$script_dir/../packet-exchange/build/client_arm -ae -p 99 -q 7 -f eth0 -i $interval 192.168.99.25"; echo "$script_dir/../packet-exchange/build/client_arm $client_options -i $interval 192.168.99.25";
$script_dir/../packet-exchange/build/client_arm -ae -p 99 -q 7 -f eth0 -i $interval 192.168.99.25; $script_dir/../packet-exchange/build/client_arm $client_options -i $interval 192.168.99.25;
elif [ -n "${use_pfast}" ]; then
echo "$script_dir/create_qdisc -p";
$script_dir/create_qdisc -p;
echo "$script_dir/../packet-exchange/build/client_arm -a -p 99 -q 1 -f eth0 -i $interval 192.168.99.25";
$script_dir/../packet-exchange/build/client_arm -a -p 99 -q 1 -f eth0 -i $interval 192.168.99.25;
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment