summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranweshadas <anwesha@das.community>2022-05-06 15:33:20 +0200
committeranweshadas <anwesha@das.community>2022-05-06 15:33:20 +0200
commit848a1ad7ebb7a0da65724d56a66a272053619e2d (patch)
treea5b5a7d7d3f0dbe007999493cc7db0c4b9c64225
parentab44c6b0722da0a0532377297066f98ab75eccfc (diff)
Adds dig command
-rw-r--r--monitor.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/monitor.sh b/monitor.sh
index 709372a..39d9b6e 100644
--- a/monitor.sh
+++ b/monitor.sh
@@ -4,11 +4,15 @@ links=("https://poc.sigsum.org/crocodile-icefish/sigsum/v0/get-tree-head-cosigne
for url in ${links[@]};
do
-echo $url
+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 $url is down. status_code $http_code
+ echo Fatal. $url is down. status_code $http_code
+ domain_name=$(echo $url | awk -F[/:] '{print $4}')
+ echo domain=$domain_name
+ dig_response=$(dig $domain_name)
+ echo $dig_response #this is for testing purpose. To be removed in thhe final code.
else
echo $url is working. status_code $http_code
fi