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