Skip to content

Instantly share code, notes, and snippets.

@benwei
Created December 6, 2019 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwei/9e37a107b07962ac63ed3b5d6b85046c to your computer and use it in GitHub Desktop.
Save benwei/9e37a107b07962ac63ed3b5d6b85046c to your computer and use it in GitHub Desktop.
a testing ash script for iperf periodically
#!/bin/sh
IP=$1
if [ "x$IP" = x ]; then
echo "syntax: <ServerIP>"
exit 1
fi
PERIOD=3600
BITS=5M
run_batch_iperf()
{
dt="$1"
datestr=`date +"%Y%m%d_%H%M%S"`
fn="/mnt/mmc0/perf${datestr}.log"
echo "D${datestr}" > $fn
/mnt/mmc0/iperf2_arm -i 2 -t $dt -c $IP -b $BITS >> $fn
}
while [ 1 ]; do
run_batch_iperf $PERIOD
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment