]> zdv2.bktei.com Git - BK-2020-03.git/blobdiff - user/ping_offline.sh
feat(unitproc/find_erotica.sh):Store script for finding erotica
[BK-2020-03.git] / user / ping_offline.sh
index e5b78048743206f491e7ad0180e50e5796af0343..df4a22bceb4fd07ea94e3c2f7484c80c3c536daa 100755 (executable)
@@ -1,16 +1,17 @@
 #!/bin/bash
 # Desc:Marks the time when a remote server can be pinged.
 # Depends: GNU Coreutils 8.32 (date, sleep), iputils-ping 3:20211215-1 (ping)
 #!/bin/bash
 # Desc:Marks the time when a remote server can be pinged.
 # Depends: GNU Coreutils 8.32 (date, sleep), iputils-ping 3:20211215-1 (ping)
-# Version: 0.0.1
+# Version: 0.0.2
 
 delay=10;
 domain="google.com"
 
 if [[ -n "$1" ]]; then domain="$1"; fi;
 
 
 delay=10;
 domain="google.com"
 
 if [[ -n "$1" ]]; then domain="$1"; fi;
 
+SECONDS=0;
 printf "%s:STATUS:Starting ping...\n" "$(date -Is)";
 while ! ping -c1 "$domain"; do
     sleep "$delay";
 done;
 printf "%s:STATUS:Starting ping...\n" "$(date -Is)";
 while ! ping -c1 "$domain"; do
     sleep "$delay";
 done;
-printf "%s:Ping resolved.\n" "$(date -Is)";
+printf "%s:Ping resolved after $SECONDS seconds.\n" "$(date -Is)";
 exit 0;
 exit 0;