From 4bb82ded782eaa8ae7e9fb2d798cb96a4c2a723c Mon Sep 17 00:00:00 2001
From: BlubbFish <git@blubbfish.net>
Date: Mon, 8 Jul 2019 18:45:19 +0200
Subject: [PATCH] Update Lora and Lora-Bot change update.sh so that it init the
 repositorys

---
 Lora      |   2 +-
 Lora-Bot  |   2 +-
 update.sh | 212 +++++++++++++++++++++++++++++++++++++++++-------------
 3 files changed, 166 insertions(+), 50 deletions(-)

diff --git a/Lora b/Lora
index cb9d882..d6796cf 160000
--- a/Lora
+++ b/Lora
@@ -1 +1 @@
-Subproject commit cb9d8824d7e466b94341b97f5050a01e5a5f616a
+Subproject commit d6796cf4eb4e9514c3fc386b21d2ca9930c694ac
diff --git a/Lora-Bot b/Lora-Bot
index 997a050..f83a8e9 160000
--- a/Lora-Bot
+++ b/Lora-Bot
@@ -1 +1 @@
-Subproject commit 997a0508531a2c9bd7374a1cc2d443942ce01f99
+Subproject commit f83a8e933a9f964b7ebd8bb6958fe7f2fab74b68
diff --git a/update.sh b/update.sh
index 64dda93..85c471b 100644
--- a/update.sh
+++ b/update.sh
@@ -1,50 +1,166 @@
-echo "Switch to subdir Librarys"
-cd Librarys
-echo "Pull litjson"
-cd litjson
-git pull
-cd ..
-echo "Pull Mono.Posix"
-cd Mono.Posix
-git pull
-cd ..
-echo "Pull mqtt"
-cd mqtt
-git pull
-cd ..
-echo "Pull RaspberryIO"
-cd RaspberryIO
-git pull
-cd ..
-cd ..
+#!/bin/bash
+echo "Pull Librarys/litjson"
+if [ -a Librarys/litjson/.git ] 
+then
+	cd Librarys/litjson
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Librarys/litjson
+	cd Librarys/litjson
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Librarys/Mono.Posix"
+if [ -a Librarys/Mono.Posix/.git ] 
+then
+	cd Librarys/Mono.Posix
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Librarys/Mono.Posix
+	cd Librarys/Mono.Posix
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Librarys/mqtt"
+if [ -a Librarys/mqtt/.git ] 
+then
+	cd Librarys/mqtt
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Librarys/mqtt
+	cd Librarys/mqtt
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Librarys/RaspberryIO"
+if [ -a Librarys/RaspberryIO/.git ] 
+then
+	cd Librarys/RaspberryIO
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Librarys/RaspberryIO
+	cd Librarys/RaspberryIO
+	git checkout master
+	cd ..
+	cd ..
+fi
+
 echo "Pull Lora"
-cd Lora
-git pull
-cd ..
+if [ -a Lora/.git ] 
+then
+	cd Lora
+	git pull
+	cd ..
+else
+	git submodule update --init --  Lora
+	cd Lora
+	git checkout master
+	cd ..
+fi
+
 echo "Pull Lora-Bot"
-cd Lora-Bot
-git pull
-cd ..
-echo "Switch to subdir Utils"
-cd Utils
-echo "Pull Bot-Utils"
-cd Bot-Utils
-git pull
-cd ..
-echo "Pull ConnectorDataMqtt"
-cd ConnectorDataMqtt
-git pull
-cd ..
-echo "Pull Iot-Interfaces"
-cd Iot-Interfaces
-git pull
-cd ..
-echo "Pull Utils"
-cd Utils
-git pull
-cd ..
-echo "Pull Utils-IoT"
-cd Utils-IoT
-git pull
-cd ..
-read -p "Press return"
\ No newline at end of file
+if [ -a Lora-Bot/.git ] 
+then
+	cd Lora-Bot
+	git pull
+	cd ..
+else
+	git submodule update --init --  Lora-Bot
+	cd Lora-Bot
+	git checkout master
+	cd ..
+fi
+
+echo "Pull Utils/Bot-Utils"
+if [ -a Utils/Bot-Utils/.git ] 
+then
+	cd Utils/Bot-Utils
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Utils/Bot-Utils
+	cd Utils/Bot-Utils
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Utils/ConnectorDataMqtt"
+if [ -a Utils/ConnectorDataMqtt/.git ] 
+then
+	cd Utils/ConnectorDataMqtt
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Utils/ConnectorDataMqtt
+	cd Utils/ConnectorDataMqtt
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Utils/Iot-Interfaces"
+if [ -a Utils/Iot-Interfaces/.git ] 
+then
+	cd Utils/Iot-Interfaces
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Utils/Iot-Interfaces
+	cd Utils/Iot-Interfaces
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Utils/Utils"
+if [ -a Utils/Utils/.git ] 
+then
+	cd Utils/Utils
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Utils/Utils
+	cd Utils/Utils
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+echo "Pull Utils/Utils-IoT"
+if [ -a Utils/Utils-IoT/.git ] 
+then
+	cd Utils/Utils-IoT
+	git pull
+	cd ..
+	cd ..
+else
+	git submodule update --init --  Utils/Utils-IoT
+	cd Utils/Utils-IoT
+	git checkout master
+	cd ..
+	cd ..
+fi
+
+if [ -z "$1" ]
+then
+	read -p "Please Press key"
+fi
\ No newline at end of file
-- 
GitLab