From bb3cc0fc34a463e0bf50451bb4868ba2e699027e Mon Sep 17 00:00:00 2001
From: Jerome Charaoui <jerome@riseup.net>
Date: Sun, 14 Jan 2018 15:24:49 -0500
Subject: [PATCH] [borg] remove unnecessary proxy variable

---
 handlers/borg.helper.in | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/handlers/borg.helper.in b/handlers/borg.helper.in
index 19b3cce9..bb9dff96 100644
--- a/handlers/borg.helper.in
+++ b/handlers/borg.helper.in
@@ -133,23 +133,20 @@ do_borg_local_dir() {
    fi
 
    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 $result in
-            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."
+            dir_status=failed
+         fi
       fi
    fi
 
-- 
GitLab