summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-21 09:14:06 +0100
committerErich Eckner <git@eckner.net>2019-01-21 09:14:06 +0100
commit5526fedab7cf69432f4643e58566367d49efeeed (patch)
tree87f9e3a05d875e4efdbe4b133435fc5ab9892f81
parent42ba782994b2dc269987160055a019c47e7c29f4 (diff)
downloadhardlinkedBackups-5526fedab7cf69432f4643e58566367d49efeeed.tar.xz
backup.in: check for availability of client _after_ checking that there is no recent backup
-rwxr-xr-xbackup.in20
1 files changed, 13 insertions, 7 deletions
diff --git a/backup.in b/backup.in
index 3caf3ca..b6d87b7 100755
--- a/backup.in
+++ b/backup.in
@@ -68,13 +68,6 @@ else
usage
fi
-if [ -n "${QuellIP}" ]; then
- ping -c1 ${QuellIP} > /dev/null || exit 11
-fi
-if [ -n "${HoppIP}" ]; then
- ping -c1 ${HoppIP} > /dev/null || exit 11
-fi
-
if [ ! -d ${Basis} ]; then
for neededMount in "${neededMounts[@]}"; do
if ! mountpoint -q "${neededMount}"; then
@@ -109,6 +102,19 @@ fi
echo $$ > "${pidFile}"
+if [ -n "${QuellIP}" ]; then
+ if ! ping -c1 ${QuellIP} >/dev/null; then
+ rm "${pidFile}"
+ exit 11
+ fi
+fi
+if [ -n "${HoppIP}" ]; then
+ if ! ping -c1 ${HoppIP} >/dev/null; then
+ rm "${pidFile}"
+ exit 11
+ fi
+fi
+
if [ -n "${tunnelBefehl}" ]; then
${tunnelBefehl} &
backgroundPid=$!