From df489971a659cba17012cb1d82cbb8369425597a Mon Sep 17 00:00:00 2001 From: anweshadas Date: Mon, 9 May 2022 10:09:24 +0200 Subject: Moves the script to the right dir --- monitor.sh | 24 ------------------------ scripts/monitor.sh | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 monitor.sh create mode 100644 scripts/monitor.sh diff --git a/monitor.sh b/monitor.sh deleted file mode 100644 index bc274a8..0000000 --- a/monitor.sh +++ /dev/null @@ -1,24 +0,0 @@ - #!/bin/bash - -links=("https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-cosigned" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-to-cosign" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-leaves/0/1" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-consistency-proof/1/3") - -for url in ${links[@]}; -do -echo $url #this is for testing purpose. To be removed in thhe final code. - response=$(curl -s -w "%{http_code}" $url) - http_code=$(tail -n1 <<< "$response") - if [[ "$http_code" != 200 ]]; then - echo Fatal. $url is down. status_code $http_code - domain_name=$(echo $url | awk -F[/:] '{print $4}') - echo $domain_name - # 1. Find IP address via dig - # 2. Check if we can ping the ip address - ip_address=$(dig +short $domain_name) - echo $dig_response #this is for testing purpose. To be removed in thhe final code. - #ping_response=$(ping $ip_address) - else - echo $url is working. status_code $http_code - fi -done - - diff --git a/scripts/monitor.sh b/scripts/monitor.sh new file mode 100644 index 0000000..bc274a8 --- /dev/null +++ b/scripts/monitor.sh @@ -0,0 +1,24 @@ + #!/bin/bash + +links=("https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-cosigned" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-to-cosign" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-leaves/0/1" "https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-consistency-proof/1/3") + +for url in ${links[@]}; +do +echo $url #this is for testing purpose. To be removed in thhe final code. + response=$(curl -s -w "%{http_code}" $url) + http_code=$(tail -n1 <<< "$response") + if [[ "$http_code" != 200 ]]; then + echo Fatal. $url is down. status_code $http_code + domain_name=$(echo $url | awk -F[/:] '{print $4}') + echo $domain_name + # 1. Find IP address via dig + # 2. Check if we can ping the ip address + ip_address=$(dig +short $domain_name) + echo $dig_response #this is for testing purpose. To be removed in thhe final code. + #ping_response=$(ping $ip_address) + else + echo $url is working. status_code $http_code + fi +done + + -- cgit v1.2.3