Last active
December 23, 2015 18:09
-
-
Save 0xa/6673857 to your computer and use it in GitHub Desktop.
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 | |
TESTV='10.99.0.20' | |
TEST4='8.8.4.4' | |
TEST6='2001:4860:4860::8888' | |
TEST_DOMAIN='google.com' | |
VPN_DNS='10.99.0.20' | |
EXT_DNS='8.8.4.4' | |
OUTPUT=$(mktemp --suffix='.txt') | |
c+=("uname -a") | |
c+=("openvpn --version") | |
c+=("pidof openvpn") | |
c+=("ping $TESTV -w 2") | |
c+=("traceroute -4 -w 2 -m 20 $TESTV") | |
c+=("ping $TEST4 -w 2") | |
c+=("traceroute -4 -w 2 -m 20 $TEST4") | |
c+=("ping6 $TEST6 -w 2") | |
c+=("traceroute -6 -w 2 -m 20 $TEST6") | |
# links/addresses | |
c+=("ip -4 addr") | |
c+=("ip -6 addr") | |
# routing table | |
c+=("ip -4 route") | |
c+=("ip -6 route") | |
# DNS | |
c+=("cat /etc/resolv.conf") | |
c+=("dig $TEST_DOMAIN +time=2") | |
c+=("dig $TEST_DOMAIN @$EXT_DNS +time=2") | |
c+=("dig $TEST_DOMAIN @$VPN_DNS +time=2") | |
echo "This script will run multiple system and networking tests." | |
echo "It may take a few minutes to complete." | |
echo "----------------------------------------" | |
for c in "${c[@]}"; do | |
echo "running: $c" | |
echo "--------------------" >> $OUTPUT | |
echo "> $c" >> $OUTPUT | |
eval "$c" >> $OUTPUT 2>> $OUTPUT | |
echo >> $OUTPUT | |
done | |
echo "----------------------------------------" | |
echo "saved to $OUTPUT" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment