From 6148e54e1f1acb84c1e9fa5010dc5ff3316ef2d3 Mon Sep 17 00:00:00 2001
From: Christopher Spinrath <christopher.fsmpi.rwth-aachen.de>
Date: Sun, 28 Sep 2014 18:35:47 +0200
Subject: [PATCH] patch_stick.sh: add support for update_stick.sh

Newer versions of the LIP-Image may contain an
update_stick.sh script. Use this script instead of plain
git commands if possible.
---
 Installer-USB-Stick/patch_stick.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Installer-USB-Stick/patch_stick.sh b/Installer-USB-Stick/patch_stick.sh
index 14dd4de..ccdfe27 100755
--- a/Installer-USB-Stick/patch_stick.sh
+++ b/Installer-USB-Stick/patch_stick.sh
@@ -4,6 +4,7 @@ set -e
 
 DEVICE=$(blkid -t LABEL=MULTIBOOT -odevice)
 MPOINT=/mnt
+UPDATE_SCRIPT="./scripts/update_stick.sh"
 
 if [ ! $EUID -eq 0 ]; then
     echo "You are not root..."
@@ -18,8 +19,15 @@ fi
 mount "$DEVICE" "$MPOINT"
 pushd "$MPOINT" > /dev/null
 
-git checkout master
-git pull
+if [ -e "$UPDATE_SCRIPT" ]; then
+    echo "Using $UPDATE_SCRIPT."
+    bash ./scripts/update_stick.sh
+else
+    echo "No $UPDATE_SCRIPT avaiable."
+    echo "Falling back to plain git commands."
+    git checkout master
+    git pull
+fi
 
 popd > /dev/null
 
-- 
GitLab