From d4910950c62af77fec10fdc0cb6cc51c1caeea79 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 8 Oct 2022 16:40:04 -0500 Subject: [PATCH] Update pibackup.sh --- pibackup.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pibackup.sh b/pibackup.sh index 6681062..ac9b59c 100755 --- a/pibackup.sh +++ b/pibackup.sh @@ -1,6 +1,6 @@ #!/bin/bash -TEST=false; +TEST=true; if [ "$1" != "update" ]; then @@ -23,11 +23,18 @@ if [ "$1" != "update" ]; then echo "$(date) - Checking for mounted Backup Drive..." if [ ! -f ${MountPoint}/mounted ]; then echo "$(date) - Not found, mounting drive now..." - mount.cifs ${ServerName} ${MountPoint} -o user=${UserName},password=${Password} - sleep 15s - if [ ! -f ${MountPoint}/mounted ]; then - echo "$(date) - Backup Drive mounted" - else + #mount.cifs ${ServerName} ${MountPoint} -o user=${UserName},password=${Password} + + until [ $c > 59 ]; do + if [ ! -f ${MountPoint}/mounted ]; then + echo "$(date) - Backup Drive mounted" + c=100 + else + c=`expr $c + 1` + sleep 1s + fi + done + if [ $c != 100 ]; then echo "$(date) - Backup Drive COULD NOT be mounted... exiting" exit 1 fi