echo"Testing to see if the borg backup directory exists and is writable"
test-d$borg_directory
if[$?= 0 ];then
test-w$borg_directory
if[$?!= 0 ];then
if[test-d"$borg_directory"];then
if[test-w"$borg_directory"];then
msgBox "destination directory is not writable!""The destination directory is not writable by the user you specified. Please fix the permissions on the directory and then try again."
dir_status=failed
fi
else
booleanBox "Destination does not exist""The destination backup directory does not exist, do you want me to create it for you?"
if[$?= 0 ];then
mkdir-p$borg_directory
result=$?
case$resultin
0) msgBox "$borg_title: success""Creation of the destination directory was a success!";;
1) msgBox "$borg_title: error""Creation of the destination directory failed, check the directory permissions."
dir_status=failed;;
esac
if mkdir-p"$borg_directory";then
msgBox "$borg_title: success""Creation of the destination directory was a success!"
else
msgBox "$borg_title: error""Creation of the destination directory failed, check the directory permissions."