From 9719271e22fb78a2107789435aebb0cde03e5dbd Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 4 Apr 2020 14:34:41 +0200 Subject: [PATCH] Update scripts --- nodes/fsn1/.DS_Store | Bin 0 -> 6148 bytes .../fsn1/netcheck.sh | 4 +- nodes/fsn2/netcheck.sh | 150 +++++++++++++++++ nodes/hel1/netcheck.sh | 151 +++++++++++++++++ nodes/nbg1/netcheck.sh | 153 ++++++++++++++++++ scripts/.DS_Store | Bin 0 -> 6148 bytes 6 files changed, 457 insertions(+), 1 deletion(-) create mode 100644 nodes/fsn1/.DS_Store rename scripts/netcheck_dn42.sh => nodes/fsn1/netcheck.sh (98%) create mode 100755 nodes/fsn2/netcheck.sh create mode 100755 nodes/hel1/netcheck.sh create mode 100755 nodes/nbg1/netcheck.sh create mode 100644 scripts/.DS_Store diff --git a/nodes/fsn1/.DS_Store b/nodes/fsn1/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" ($(dig +short -x $2 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $2 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$2$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$2$host${GREY} is ${RED}down${NC}" + fi + + host=" (v4)" + timeout 1 ping -c 1 $3 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$3$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$3$host${GREY} is ${RED}down${NC}" + fi + + host=" (v6)" + timeout 1 ping -6 -c 1 $3 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$3$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$3$host${GREY} is ${RED}down${NC}" + fi +} + +pingtest(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" ($(dig +short -x $2 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $2 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$2$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$2$host${GREY} is ${RED}down${NC}" + fi +} + +pingtest6(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)')" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi +} + +dnspingtest(){ + host=" (v4)" + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" (v6)" + timeout 1 ping -6 -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi +} + +webtest4(){ + ip4=$(curl -s -4 --connect-timeout 1 $1) + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv4 to ${NC}$1${GREY} is ${GREEN}$ip4${NC}" + else + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv4 to ${NC}$1${GREY} is ${RED}unknown${NC}" + fi +} + +webtest6(){ + ip6=$(curl -s -6 --connect-timeout 1 $1) + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv6 to ${NC}$1${GREY} is ${GREEN}$ip6${NC}" + else + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv6 to ${NC}$1${GREY} is ${RED}unknown${NC}" + fi +} + +webtest(){ + webtest4 $1 + webtest6 $1 +} + +echo -e "[${GREEN}INFO${NC}]${GREY} Scan started on $(date "+%Y-%m-%d %H:%M:%S")${NC}" + +pingtest "172.20.177.33" "fdff:b02d:2ef7::2" +pingtest "172.20.177.34" "fdff:b02d:2ef7::3" +pingtest "172.20.177.35" "fdff:b02d:2ef7::4" + +webtest nbg1.dn42.zotan.network + +webtest4 ip4.dn42 +webtest6 ip6.dn42 + +dnspingtest "burble.dn42" diff --git a/nodes/hel1/netcheck.sh b/nodes/hel1/netcheck.sh new file mode 100755 index 0000000..025b1a2 --- /dev/null +++ b/nodes/hel1/netcheck.sh @@ -0,0 +1,151 @@ +#!/bin/bash +export RED='\033[0;31m' +export GREEN='\033[0;32m' +export GREY='\033[0;37m' +export NC='\033[0m' # No Color + +fullpingtest(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" ($(dig +short -x $2 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $2 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$2$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$2$host${GREY} is ${RED}down${NC}" + fi + + host=" (v4)" + timeout 1 ping -c 1 $3 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$3$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$3$host${GREY} is ${RED}down${NC}" + fi + + host=" (v6)" + timeout 1 ping -6 -c 1 $3 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$3$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$3$host${GREY} is ${RED}down${NC}" + fi +} + +pingtest(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" ($(dig +short -x $2 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $2 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$2$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$2$host${GREY} is ${RED}down${NC}" + fi +} + +pingtest6(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)')" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi +} + +dnspingtest(){ + host=" (v4)" + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" (v6)" + timeout 1 ping -6 -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi +} + +webtest4(){ + ip4=$(curl -s -4 --connect-timeout 1 $1) + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv4 to ${NC}$1${GREY} is ${GREEN}$ip4${NC}" + else + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv4 to ${NC}$1${GREY} is ${RED}unknown${NC}" + fi +} + +webtest6(){ + ip6=$(curl -s -6 --connect-timeout 1 $1) + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv6 to ${NC}$1${GREY} is ${GREEN}$ip6${NC}" + else + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv6 to ${NC}$1${GREY} is ${RED}unknown${NC}" + fi +} + +webtest(){ + webtest4 $1 + webtest6 $1 +} + +echo -e "[${GREEN}INFO${NC}]${GREY} Scan started on $(date "+%Y-%m-%d %H:%M:%S")${NC}" + +pingtest "172.22.159.62" "fdfc:694e:234f::affa" +pingtest "172.20.177.33" "fdff:b02d:2ef7::2" +pingtest "172.20.177.34" "fdff:b02d:2ef7::3" +pingtest "172.20.177.36" "fdff:b02d:2ef7::5" + +webtest nbg1.dn42.zotan.network + +webtest4 ip4.dn42 +webtest6 ip6.dn42 + +dnspingtest "burble.dn42" diff --git a/nodes/nbg1/netcheck.sh b/nodes/nbg1/netcheck.sh new file mode 100755 index 0000000..47994a2 --- /dev/null +++ b/nodes/nbg1/netcheck.sh @@ -0,0 +1,153 @@ +#!/bin/bash +export RED='\033[0;31m' +export GREEN='\033[0;32m' +export GREY='\033[0;37m' +export NC='\033[0m' # No Color + +fullpingtest(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" ($(dig +short -x $2 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $2 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$2$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$2$host${GREY} is ${RED}down${NC}" + fi + + host=" (v4)" + timeout 1 ping -c 1 $3 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$3$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$3$host${GREY} is ${RED}down${NC}" + fi + + host=" (v6)" + timeout 1 ping -6 -c 1 $3 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$3$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$3$host${GREY} is ${RED}down${NC}" + fi +} + +pingtest(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" ($(dig +short -x $2 | tail -n 1 | grep -Po '.*(?=\.)'))" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $2 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$2$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$2$host${GREY} is ${RED}down${NC}" + fi +} + +pingtest6(){ + host=" ($(dig +short -x $1 | tail -n 1 | grep -Po '.*(?=\.)')" + if [[ $? -ne 0 ]]; then + host="" + fi + + timeout 1 ping -6 -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi +} + +dnspingtest(){ + host=" (v4)" + timeout 1 ping -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi + + host=" (v6)" + timeout 1 ping -6 -c 1 $1 &>/dev/null + + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}PASS${NC}]${GREY} Host ${NC}$1$host${GREY} is ${GREEN}up${NC}" + else + echo -e "[${RED}FAIL${NC}]${GREY} Host ${NC}$1$host${GREY} is ${RED}down${NC}" + fi +} + +webtest4(){ + ip4=$(curl -s -4 --connect-timeout 1 $1) + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv4 to ${NC}$1${GREY} is ${GREEN}$ip4${NC}" + else + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv4 to ${NC}$1${GREY} is ${RED}unknown${NC}" + fi +} + +webtest6(){ + ip6=$(curl -s -6 --connect-timeout 1 $1) + if [[ $? -eq 0 ]]; then + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv6 to ${NC}$1${GREY} is ${GREEN}$ip6${NC}" + else + echo -e "[${GREEN}INFO${NC}]${GREY} Your Source IPv6 to ${NC}$1${GREY} is ${RED}unknown${NC}" + fi +} + +webtest(){ + webtest4 $1 + webtest6 $1 +} + +echo -e "[${GREEN}INFO${NC}]${GREY} Scan started on $(date "+%Y-%m-%d %H:%M:%S")${NC}" + +pingtest6 "fe80::42:2341:2%dn42p1" +pingtest "172.20.53.97" "fe80::ade0%dn42p2" +pingtest "172.20.175.193" "fe80::42%dn42p3" +pingtest "172.20.177.33" "fdff:b02d:2ef7::2" +pingtest "172.20.177.35" "fdff:b02d:2ef7::4" +pingtest "172.20.177.36" "fdff:b02d:2ef7::5" + +webtest fsn1.dn42.zotan.network + +webtest4 ip4.dn42 +webtest6 ip6.dn42 + +dnspingtest "burble.dn42" \ No newline at end of file diff --git a/scripts/.DS_Store b/scripts/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0