Execute removal of log files after sourcing config files
authorMichael Prokop <devnull@localhost>
Sun, 9 Dec 2007 18:20:45 +0000 (19:20 +0100)
committerMichael Prokop <devnull@localhost>
Sun, 9 Dec 2007 18:20:45 +0000 (19:20 +0100)
debian/changelog
grml-live

index 6429a49..13ff765 100644 (file)
@@ -17,6 +17,7 @@ grml-live (0.0.12) unstable; urgency=low
   * Do not exit if cleanup of /root directory in 98-clean-chroot fails.
   * Skip stage updatebase when using softupdate and handle upgrade
     on our own via hooks.
+  * Execute removal of log files after sourcing config files.
 
  -- Michael Prokop <mika@grml.org>  Sun, 09 Dec 2007 17:28:01 +0100
 
index 97a0388..67b339f 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -91,19 +91,6 @@ fi
 touch $LOGFILE
 chown root:adm $LOGFILE
 chmod 640 $LOGFILE
-# clean/zero grml-live logfile:
-if [ -n "$ZERO_LOGFILE" ] ; then
-   echo -n > $LOGFILE
-fi
-
-# clean/zero/remove old FAI directory:
-if [ -n "$ZERO_FAI_LOGFILE" ] ; then
-   if [ -d /var/log/fai/"$HOSTNAME" ] ; then
-      rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last)"
-      rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-dirinstall)"
-      rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-softupdate)"
-   fi
-fi
 
 NFSROOT_CONF=/etc/grml/fai/make-fai-nfsroot.conf
 
@@ -232,6 +219,24 @@ else
    log "No $LOCAL_CONFIG found, not sourcing it"
    LOCAL_CONFIG=''
 fi
+
+# clean/zero grml-live logfile:
+if [ -n "$ZERO_LOGFILE" ] ; then
+   echo -n > $LOGFILE
+fi
+
+# clean/zero/remove old FAI directory:
+if [ -n "$ZERO_FAI_LOGFILE" ] ; then
+   if [ -d /var/log/fai/"$HOSTNAME" ] ; then
+      rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last)"
+      rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-dirinstall)"
+      rm -rf /var/log/fai/"$HOSTNAME"/"$(readlink /var/log/fai/"$HOSTNAME"/last-softupdate)"
+      rm -f /var/log/fai/"$HOSTNAME"/last \
+            /var/log/fai/"$HOSTNAME"/last-dirinstall \
+            /var/log/fai/"$HOSTNAME"/last-softupdate
+   fi
+fi
+
 # }}}
 
 # ask user whether the setup is ok {{{