From 20dc751c0cc775e6098d9b4d324efa428803047e Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Fri, 20 Jan 2006 19:56:11 +0000 Subject: 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 --- initrd/initrd-stuff/etc/functions | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'initrd/initrd-stuff/etc/functions') 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 , 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 -- cgit v1.2.3-55-g7522