Created
March 10, 2019 18:02
-
-
Save Anime4000/6f0645e9e16c729bcc07af36feceb9e0 to your computer and use it in GitHub Desktop.
VyOS Network Stress Test PPPoE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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