Files
shell-scripting-templates/setupScripts/fileTest.sh
Nathaniel Landau 238f27e581 New script template
2015-01-07 22:59:39 -05:00

34 lines
772 B
Bash
Executable File

#!/usr/bin/env bash
# This script tests for the existence of certain files in Dropbox.
# It is used to keep a current list in the mackup.sh script.
if [ -f "../lib/utils.sh" ]; then
source "../lib/utils.sh"
else
echo "You must have utils.sh to run. Exiting."
exit 0
fi
# Variables from config file
if is_file "../etc/mackup.cfg"; then
source "../etc/mackup.cfg"
TESTFILE="$TESTCFG"
else
die "Can not run without config file"
fi
if is_not_file "$TESTFILE"; then
die "Could not find $TESTFILE. Exiting."
else
notice "Confirming that Dropbox has synced..."
while IFS= read -r file
do
while [ ! -e $HOME/"$file" ] ;
do
notice "Waiting for Dropbox to Sync files."
sleep 10
done
success "Found $file"
done < "$TESTFILE"
fi