Skip to content

Commit

Permalink
Execute removal of log files after sourcing config files
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Prokop committed Dec 9, 2007
1 parent 1227c08 commit 67304be
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions debian/changelog
Expand Up @@ -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

Expand Down
31 changes: 18 additions & 13 deletions grml-live
Expand Up @@ -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

Expand Down Expand Up @@ -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 {{{
Expand Down

0 comments on commit 67304be

Please sign in to comment.