Skip to content

Instantly share code, notes, and snippets.

@Anime4000
Created March 10, 2019 18:02
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 Anime4000/6f0645e9e16c729bcc07af36feceb9e0 to your computer and use it in GitHub Desktop.
Save Anime4000/6f0645e9e16c729bcc07af36feceb9e0 to your computer and use it in GitHub Desktop.
VyOS Network Stress Test PPPoE
#!/bin/bash
killall -9 iperf 2> /dev/null
echo "[INFO]: Hello!"
while :
do
sleep 10s
if ip link show | grep -q pppoe0 ; then
if pidof iperf > /dev/null ; then
echo "[INFO]: pppoe0 is up and iperf is running"
continue
else
echo "[INFO]: connection restored! waiting..."
sleep 30s
echo "[$(date +'%F %T')]: pppoe0 inet is $(ip addr | grep 'pppoe0' | tail -n1 | awk '{print $2}')" >> pppoe0.inet.log
echo "[INFO]: iperf is executing..."
iperf -c 1.1.1.1 -p 5600 -t 600 -d -P 3 &
fi
else
echo "[WARN]: pppoe0 is down!"
killall -9 iperf 2> /dev/null
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment