aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAnwesha Das <anwesha@das.community>2022-05-24 12:03:28 +0200
committerAnwesha Das <anwesha@das.community>2022-05-24 12:03:28 +0200
commit06973e1d237e338ec6ca59e50662c7901bd9fc51 (patch)
tree846bc6554692684924907ac00157b47457a3bc8b /scripts
parent35cd7d5a97f6903cf303d244a9423405ddad5ad9 (diff)
Updates code to include IPaddr in fail msg
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/monitor.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/monitor.sh b/scripts/monitor.sh
index bb82877..cd4d417 100755
--- a/scripts/monitor.sh
+++ b/scripts/monitor.sh
@@ -11,7 +11,7 @@ function check_dns_ping() {
ip_addr=$(echo $response | tail -1 | cut -d' ' -f 2)
ping -c 1 $ip_addr
if [ $? -ne 0 ]; then
- msg="$(date +"%y-%m-%d %H:%M:%S %Z") Failure: Can not reach IPv4"
+ msg="$(date +"%y-%m-%d %H:%M:%S %Z") Failure: Can not reach IPv4 $ip_addr"
full_msg="$msg $response"
fail "$full_msg"
fi
@@ -23,7 +23,7 @@ function check_ipv6_dns_ping() {
ip_addr=$(echo $response | tail -1 | cut -d' ' -f 2)
ping -c 1 $ip_addr
if [ $? -ne 0 ]; then
- msg="$(date +"%y-%m-%d %H:%M:%S %Z") Failure: Can not reach IPv4"
+ msg="$(date +"%y-%m-%d %H:%M:%S %Z") Failure: Can not reach IPv6 $ip_addr"
full_msg="$msg $response"
fail "$full_msg"
fi