BASH - Test Connection Simple script

From Wiki.IT-Arts.net
Revision as of 08:56, 11 November 2024 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Test Connection Simple Script

#!/bin/bash


IP_POOL="8.8.8.8 8.8.4.4 google.com"
HITS=2

echo "#############################"
echo "#####    Ping"
echo "#############################"
for a in $IP_POOL; do

	ping $a -c $HITS

done


echo "#############################"
echo "Internet IP Address";
echo "#############################";
echo "# Wget chekip.dyndns.org Method:";
wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//';
echo "############"
echo "# Curl ifconfig.me Method:";
curl ifconfig.me;
echo ""

echo "##############################"
echo "##### Traceroute 8.8.8.8"
traceroute 8.8.8.8

echo "#############################"
echo "#####    /etc/resolv.conf"
echo "#############################"
cat /etc/resolv.conf


echo "#############################"
echo "#####    route -n"
echo "#############################"
route -n


exit 0