Sunday, August 03, 2014

Improved script file "synclamp"

Initially synclamp (described elsewhere) tried to create its destination directory if it did not exist. I decided to check for its existence and exit synclamp with an error message.

Here is the old code:-
echo Ensuring destination directory $FILES_STICK exists
mkdir -p $FILES_STICK

Here is the updated code:
# August 2014. If memory stick not found then exit with error message
 if [ ! -d $FILES_STICK ] ; then
    echo "Please insert missing memory stick $FILES_STICK";
    exit 1;
fi;