# HG changeset patch
# User Sascha Wilde <wilde@intevation.de>
# Date 1410958879 -7200
# Node ID f1384bf9d4a4fa190f748f91b2f42452cc897cb1
# Parent  54a6fa9e44cfec90abf574e7b4db5445881cdce2# Parent  521032de3a0a384469d67b6c7e68b82ac074bac3
Mergerd

diff -r 521032de3a0a -r f1384bf9d4a4 packaging/linux-installer.inc.in
--- a/packaging/linux-installer.inc.in	Wed Sep 17 13:39:02 2014 +0200
+++ b/packaging/linux-installer.inc.in	Wed Sep 17 15:01:19 2014 +0200
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Um TrustBridge zu installieren:
 # 1. Prüfen Sie ob Sie dieser Datei genügend vertrauen, um ihr die Kontrolle
-#    über diesen Rechner zu übergeben. Beispielsweise durch Vergleich mit 
+#    über diesen Rechner zu übergeben. Beispielsweise durch Vergleich mit
 #    einer starken Prüfsumme aus einer zweiten, unabhängigen Quelle.
 # 2. Öffnen Sie eine Kommandozeile, z.B. klicken Sie auf das "Terminal"-Symbol.
 # 3. Wechseln Sie in das Verzeichnis, in welchem diese Datei gespeichert ist.
@@ -22,10 +22,10 @@
 # 3. Change your working directory to where this file is stored.
 #    For example type "cd ~/Desktop" on your command line.
 # 4. Start the installation on the command line, e.g. for the current user
-#    only by typing something like "bash TrustBridge-1.0.0-i386.sh". 
+#    only by typing something like "bash TrustBridge-1.0.0-i386.sh".
 #    Hint: If you press the tab-key after "Tr" it may complete the filename.
 #
-# N.B. We could not have used a .deb package, because the installation must 
+# N.B. We could not have used a .deb package, because the installation must
 # also work without without adminstrator priviledges.
 #
 #
@@ -262,12 +262,16 @@
 cleanup()
 {
   getxt "Cleaning up temporary stuff ...\n"
-  # remove temporary directories,
-  # $lock_dir is generate by the shar
-  if [ -z "${lock_dir-}" ]; then
-    exit
+
+  # remove temporary directories:
+  local -a temp_dirs
+  if [ "${lock_dir}" ]; then
+      # $lock_dir is generate by the shar
+      temp_dirs+=("${instcfg[PREFIX]}/$lock_dir")
   fi
-  for dir in "${instcfg[PREFIX]}/$lock_dir" "$extra_bin_path" ; do
+  temp_dirs+=("$extra_bin_path")
+
+  for dir in "${temp_dirs[@]}" ; do
     [ -d "$dir" ] &&
         rm -rf "$dir"
   done