X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-live;h=4e13d6c1fe47d9ecb29ea37d2fe669402201cb5b;hb=6581ee91955a2f681be1e46ce16ec12e1093eac1;hp=ab0b1c11c7fef84b4934e03445cf9447136da1e2;hpb=70d1193b5f554dce691294e5c6715b269a73a925;p=grml-live.git diff --git a/grml-live b/grml-live index ab0b1c1..4e13d6c 100755 --- a/grml-live +++ b/grml-live @@ -4,10 +4,10 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Fre Jän 11 09:09:02 CET 2008 [mika] +# Latest change: Sun Jan 20 22:38:18 CET 2008 [mika] ################################################################################ -# read configuration files, set some misc variables {{{ +# main initialization setup, set some misc variables {{{ export LANG=C export LC_ALL=C @@ -15,7 +15,7 @@ export LC_ALL=C # exit on any error: set -e -GRML_LIVE_VERSION='0.1' +GRML_LIVE_VERSION='0.2' CMDLINE="$0 $@" ISO_DATE="$(date +%Y-%m-%d)" @@ -177,6 +177,34 @@ http://grml.org/bugs/ } # }}} +# read local (non-packaged) configuration {{{ +LOCAL_CONFIG=/etc/grml/grml-live.local +if [ -r "$LOCAL_CONFIG" ] ; then + log "Sourcing $LOCAL_CONFIG" + . $LOCAL_CONFIG +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 +# }}} + # command line parsing {{{ while getopts "a:C:c:g:i:o:r:s:t:v:bFhuVz" opt; do @@ -214,35 +242,6 @@ specify it on the command line using the -c option." specify it on the command line using the -o option." # }}} -# read local (non-packaged) configuration {{{ -LOCAL_CONFIG=/etc/grml/grml-live.local -if [ -r "$LOCAL_CONFIG" ] ; then - log "Sourcing $LOCAL_CONFIG" - . $LOCAL_CONFIG -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 {{{ if [ -z "$FORCE" ] ; then echo