-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Develop features to main (#11)
* rm duplicates added rsync * added bzip, pw10 theme ownership, and consistant ADD over COPY * adding ownership and history plugin as well as rc files * codespace font setting * Coder (#6) * moar promptiness * more compatible with lesser fonting * add user to docker group * corrected docker lib reference * added dockerinfo to tasks * better separation of build env * Testing with badges and adding notes * Testing with badges and adding notes * changed workflow names * changed from app to dev container name * fixed indent filure * indenting * versioning test * removed bad version test * added Docker test tasks * added docker test tasks * added example bash script to basic-test network * Added test_net and docs
- Loading branch information
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
127.0.0.1 | ||
1.1.1.1 | ||
8.8.8.8 | ||
google.com | ||
microsoft.com | ||
failed.ip.does.not.exist |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
# File with nodes to test, one address per line | ||
NODES_FILE=./nodes.list | ||
|
||
# Test for color support | ||
# check if stdout is a terminal... | ||
if test -t 1; then | ||
|
||
# see if it supports colors... | ||
ncolors=$(tput colors) | ||
|
||
if test -n "$ncolors" && test $ncolors -ge 8; then | ||
bold="$(tput bold)" | ||
underline="$(tput smul)" | ||
standout="$(tput smso)" | ||
normal="$(tput sgr0)" | ||
black="$(tput setaf 0)" | ||
red="$(tput setaf 1)" | ||
green="$(tput setaf 2)" | ||
yellow="$(tput setaf 3)" | ||
blue="$(tput setaf 4)" | ||
magenta="$(tput setaf 5)" | ||
cyan="$(tput setaf 6)" | ||
white="$(tput setaf 7)" | ||
fi | ||
fi | ||
|
||
# Show the date this script was run | ||
date | ||
|
||
# Get the primary interface IP and device name | ||
ip4=$(/sbin/ip route get 8.8.8.8 | awk '/src/ { print $7 }') | ||
dev=$(/sbin/ip route get 8.8.8.8 | awk '/src/ { print $5 }') | ||
echo "Host IP address on $dev: $ip4" | ||
|
||
# Get external IP address | ||
external=$(dig @resolver4.opendns.com myip.opendns.com +short) | ||
echo "Public IP address: $external" | ||
|
||
# Get and test acces to the default gateway | ||
default_gateway=$(/sbin/ip route | awk '/default/ { print $3 }') | ||
ping -c 1 "$default_gateway" > /dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "- node $default_gateway (default gateway) is ${green}accessible${normal}" | ||
else | ||
echo "ERROR: default gateway ($default_gateway) is ${red}${bold}unreachable${normal}" | ||
exit 1 | ||
fi | ||
|
||
# Loop over supplied node addresses list if it exists | ||
if test -f ${NODES_FILE}; then | ||
cat ${NODES_FILE} | while read output | ||
do | ||
ping -c 1 "$output" > /dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "- node $output is ${green}accessible${normal}" | ||
else | ||
echo "- node $output is ${red}${bold}unreachable${normal}" | ||
fi | ||
done | ||
fi |