Improve directory handling for $LOGFILE
authorMichael Prokop <devnull@localhost>
Wed, 24 Oct 2007 07:27:01 +0000 (09:27 +0200)
committerMichael Prokop <devnull@localhost>
Wed, 24 Oct 2007 07:27:01 +0000 (09:27 +0200)
debian/changelog
grml-live

index da52c5e..4556636 100644 (file)
@@ -6,6 +6,7 @@ grml-live (0.0.7) unstable; urgency=low
     file.
   * Log executed grml-live command line.
   * Set $SECONDS to unknown if $start_seconds is not set.
     file.
   * Log executed grml-live command line.
   * Set $SECONDS to unknown if $start_seconds is not set.
+  * Improve directory handling for $LOGFILE.
   * Add new packages to GRML_FULL:
     - ldnsutils
 
   * Add new packages to GRML_FULL:
     - ldnsutils
 
index a9ecab0..766f588 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -4,7 +4,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2 or any later version.
-# Latest change: Sat Oct 20 12:12:23 CEST 2007 [mika]
+# Latest change: Wed Oct 24 09:26:39 CEST 2007 [mika]
 ################################################################################
 
 # read configuration files, set some misc variables {{{
 ################################################################################
 
 # read configuration files, set some misc variables {{{
@@ -69,7 +69,8 @@ trap bailout 1 2 3 15
 [ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks"
 [ -n "$GRML_NAME" ] || GRML_NAME='grml'
 
 [ -n "$RELEASENAME" ] || RELEASENAME="grml-live rocks"
 [ -n "$GRML_NAME" ] || GRML_NAME='grml'
 
-if mkdir -p /var/log/fai/dirinstall/${HOSTNAME} ; then
+[ -d /var/log/fai/dirinstall/"${HOSTNAME}" ] || mkdir -p /var/log/fai/dirinstall/${HOSTNAME} 
+if [ -d /var/log/fai/dirinstall/"${HOSTNAME}" ] ; then
    LOGFILE=/var/log/fai/dirinstall/${HOSTNAME}/grml-live.log
 else
    LOGFILE="$LOGDIR/grml-live.log"
    LOGFILE=/var/log/fai/dirinstall/${HOSTNAME}/grml-live.log
 else
    LOGFILE="$LOGDIR/grml-live.log"