BASH - Test Connection Simple script: Difference between revisions

From IT-Arts.net
No edit summary
 
m Text replacement - "Category:Post-It" to "Category:Wiki"
Line 1: Line 1:
[[Category:Post-It]]
[[Category:Wiki]]


== Test Connection Simple Script ==
== Test Connection Simple Script ==

Revision as of 16:44, 8 December 2025


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