From 5526fedab7cf69432f4643e58566367d49efeeed Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 21 Jan 2019 09:14:06 +0100 Subject: backup.in: check for availability of client _after_ checking that there is no recent backup --- backup.in | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'backup.in') 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=$! -- cgit v1.2.3-54-g00ecf