]> git.treefish.org Git - backmeupscotty.git/blobdiff - backmeupscotty
Added SSH connection check.
[backmeupscotty.git] / backmeupscotty
index 35ec75498b6dc5c70960c13ef144726f3324df0a..9087a17c2a2064fb8a7a031ee783caaed7ed3c52 100644 (file)
@@ -178,10 +178,15 @@ function backmeupscotty {
        esac
     done
 
+    if (! ssh -q $REMOTE_HOST exit); then
+       scottyerror "Could not establish SSH connection to $REMOTE_HOST!"
+       exit 1
+    fi
+
     if isNthDay; then
        scottyinfo "This is the nth day."
     elif latestTooOld; then
-       scottyerror "The latest backup is too old."
+       scottyinfo "The latest backup is too old."
     else
        scottyinfo "No backup has to be done. Exiting."
        exit 0