From 67304be75bd8ee0e517ea3f8e409c06fa7a00c26 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 9 Dec 2007 19:20:45 +0100 Subject: [PATCH] Execute removal of log files after sourcing config files --- debian/changelog | 1 + grml-live | 31 ++++++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6429a49..13ff765 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sun, 09 Dec 2007 17:28:01 +0100 diff --git a/grml-live b/grml-live index 97a0388..67b339f 100755 --- 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 {{{ -- 2.1.4