diff options
author | Dirk von Suchodoletz | 2006-01-20 20:56:11 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-01-20 20:56:11 +0100 |
commit | 20dc751c0cc775e6098d9b4d324efa428803047e (patch) | |
tree | 18c97cfbb71a47d7270899ec5592dba395fc6df7 /initrd/initrd-stuff/etc/functions | |
parent | einige fixes - repco funktioniert allerdings noch nicht (diff) | |
download | core-20dc751c0cc775e6098d9b4d324efa428803047e.tar.gz core-20dc751c0cc775e6098d9b4d324efa428803047e.tar.xz core-20dc751c0cc775e6098d9b4d324efa428803047e.zip |
Heftiges Bugfixing in mkdxsinitrd ... intensiv gecheckt mit SuSE 10.0 -
wieder funktionsfähig.
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@29 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff/etc/functions')
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index e0e3bfbd..9418b637 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -1,18 +1,35 @@ +# Description: common function script for the configuration of +# linux diskless clients (included by init, hwautocfg, +# servconfig, ... within initial ramdisk) +# +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 +# Blabla +# Blub +# +# Copyright: (c) 2006 - RZ Universitaet Freiburg +# +# Version: 0.4.1b + + + ####################################################################### # produce error message and if $2 is empty run (debug) shell error() { local message="An error occured during execution of $0 script:\n\n$1\n" -# check if LOGFILE is already defined -[ -z "${LOGFILE}" ] && LOGFILE="/dev/null" # check if LOGFILE is really writeable -[ -n "${LOGFILE}" ] && [ -w /mnt/${LOGFILE} ] || LOGFILE="/dev/null" +if [ -n "${LOGFILE}" ] ; then + [ "${LOGFILE}" != "/dev/null" ] && \ + [ -w /mnt/${LOGFILE} ] || LOGFILE="/dev/null" +else LOGFILE="/dev/null" +fi # if nonfatal error else fatal error message and shell if [ -n "$2" ] ; then -[ "$DEBUGLEVEL" -ge 1 ] && \ - echo -e "{$message} This error is not fatal - continuing ...\n" \ - >> /mnt/${LOGFILE} -[ "$DEBUGLEVEL" -gt 1 ] && \ - echo -e "{$message} This error is not fatal - continuing ...\n" + [ "$DEBUGLEVEL" -ge 1 ] && \ + echo -e "$message This error is not fatal - continuing ...\n" \ + >> ${LOGFILE} + [ "$DEBUGLEVEL" -gt 1 ] && \ + echo -e "$message This error is not fatal - continuing ...\n" + [ "$DEBUGLEVEL" -gt 2 ] && usleep 20 else echo -e "Running shell for debugging purposes now ...\n" /bin/sh |