From 273044e2abef1eeebcc07165f9148fd6ea7f4192 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Fri, 21 Mar 2014 18:44:34 +0000 Subject: [PATCH] - wrap profiler in script to alter config file --- src/mesh/{profiler.conf => profiler.template} | 0 src/mesh/run_profiler.sh | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+) rename src/mesh/{profiler.conf => profiler.template} (100%) create mode 100755 src/mesh/run_profiler.sh diff --git a/src/mesh/profiler.conf b/src/mesh/profiler.template similarity index 100% rename from src/mesh/profiler.conf rename to src/mesh/profiler.template diff --git a/src/mesh/run_profiler.sh b/src/mesh/run_profiler.sh new file mode 100755 index 000000000..fe5dbbd14 --- /dev/null +++ b/src/mesh/run_profiler.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$#" -lt "1" ]; then + echo "usage: $0 PEERS"; + exit 1; +fi + +PEERS=$1 + +if [ $PEERS -eq 1 ]; then + echo "cannot run 1 peer"; + exit 1; +fi + +LINKS=`echo "l($PEERS) * $PEERS" | bc -l` +LINKS=`printf "%.0f" $LINKS` +echo "using $PEERS peers, $LINKS links"; + +sed -e "s/%LINKS%/$LINKS/g" profiler.template > profiler.conf + +./gnunet-mesh-profiler $PEERS -- 2.25.1