From 22ebb3e0459bc3c3f7363189e1339f74b4b23c6f Mon Sep 17 00:00:00 2001
From: mgreiff <marcusgreiff.93@hotmail.com>
Date: Thu, 24 Aug 2017 02:09:31 +0200
Subject: [PATCH] Clean up util files, file transfer and initialization now
 functional

---
 util/flash_BBB.sh  | 13 +++++++++++--
 util/flash_BBB.sh~ | 13 +++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/util/flash_BBB.sh b/util/flash_BBB.sh
index 60eb8bb..f8102e1 100755
--- a/util/flash_BBB.sh
+++ b/util/flash_BBB.sh
@@ -47,12 +47,21 @@ if [ "{flag}"=true ]; then
     } || { # catch
       # save log for exception
       flag=false
-      printf "${RED}Could not send folder /${project} to the BBB, aborting!${NC}\n"
+      printf "${RED}Could not send project /${project} to the BBB, aborting!${NC}\n"
     }
   done
 fi
 
-printf "${BLUE}Connecting to the BBB${NC}\n"
+printf "${BLUE}Deleting temporary files...${NC}\n"
+for project in "${projects[@]}"; do
+  {
+    rm -rf ${project}
+  } || {
+    printf "${RED}Could not delete project /${project}, aborting!${NC}\n"
+}
+done
+
+printf "${BLUE}Connecting to the BBB...${NC}\n"
 {
   ssh -t debian@192.168.7.2 "./LabConnection.jl/util/startup.sh; bash -l"
 } || {
diff --git a/util/flash_BBB.sh~ b/util/flash_BBB.sh~
index 60eb8bb..f8102e1 100755
--- a/util/flash_BBB.sh~
+++ b/util/flash_BBB.sh~
@@ -47,12 +47,21 @@ if [ "{flag}"=true ]; then
     } || { # catch
       # save log for exception
       flag=false
-      printf "${RED}Could not send folder /${project} to the BBB, aborting!${NC}\n"
+      printf "${RED}Could not send project /${project} to the BBB, aborting!${NC}\n"
     }
   done
 fi
 
-printf "${BLUE}Connecting to the BBB${NC}\n"
+printf "${BLUE}Deleting temporary files...${NC}\n"
+for project in "${projects[@]}"; do
+  {
+    rm -rf ${project}
+  } || {
+    printf "${RED}Could not delete project /${project}, aborting!${NC}\n"
+}
+done
+
+printf "${BLUE}Connecting to the BBB...${NC}\n"
 {
   ssh -t debian@192.168.7.2 "./LabConnection.jl/util/startup.sh; bash -l"
 } || {
-- 
GitLab