Hello there!
I am creating a script, that among other functions will run iperf (network stress tool) either on server or client mode.
The thing is that it will run forever if the user does not stop it or break it. CTRL-C will break it. I need a method, however, that will break iperf and then return to the script line right after where it was called:
echo -n " Choose mode: [C]lient or erver: "
read MODE
while [ "$MODE" != "C" -a "$MODE" != "S" ]
do
if [ "$MODE" == "S" ]
then
iperf -s -i 1
exit
else
if [ "$MODE" == "C" ]
then
echo ""
echo " Server IP?:"
read IP
iperf -c $IP -t 300 -i 1
exit
else
fi
fi
done
Any ideas?