Update pibackup.sh

This commit is contained in:
2022-10-08 16:40:04 -05:00
parent 1e0171c681
commit d4910950c6

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
TEST=false; TEST=true;
if [ "$1" != "update" ]; then if [ "$1" != "update" ]; then
@@ -23,11 +23,18 @@ if [ "$1" != "update" ]; then
echo "$(date) - Checking for mounted Backup Drive..." echo "$(date) - Checking for mounted Backup Drive..."
if [ ! -f ${MountPoint}/mounted ]; then if [ ! -f ${MountPoint}/mounted ]; then
echo "$(date) - Not found, mounting drive now..." echo "$(date) - Not found, mounting drive now..."
mount.cifs ${ServerName} ${MountPoint} -o user=${UserName},password=${Password} #mount.cifs ${ServerName} ${MountPoint} -o user=${UserName},password=${Password}
sleep 15s
if [ ! -f ${MountPoint}/mounted ]; then until [ $c > 59 ]; do
echo "$(date) - Backup Drive mounted" if [ ! -f ${MountPoint}/mounted ]; then
else 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" echo "$(date) - Backup Drive COULD NOT be mounted... exiting"
exit 1 exit 1
fi fi