X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Flsb-functions;h=89c3f390e20b68847f96e6c33ed0e1663e43a2ed;hb=158d2aff363f208b9216e0a7373639a926266601;hp=f565f0fc470a9f4042100a92d8b34e06176956e2;hpb=f989db8bb5c35e006c1e15319e18f65be13f52eb;p=grml-etc-core.git diff --git a/etc/grml/lsb-functions b/etc/grml/lsb-functions index f565f0f..89c3f39 100644 --- a/etc/grml/lsb-functions +++ b/etc/grml/lsb-functions @@ -37,11 +37,11 @@ _have_tput() { || return 1 } -log_success_msg () { +log_success_msg() { printf " * $@\n" } -log_failure_msg () { +log_failure_msg() { if _have_tput ; then RED="$("$TPUT" setaf 1)" #NORMAL="$("$TPUT" op)" @@ -51,7 +51,7 @@ log_failure_msg () { fi } -log_warning_msg () { +log_warning_msg() { if _have_tput ; then YELLOW="$("$TPUT" setaf 3)" #NORMAL="$("$TPUT" op")" @@ -62,7 +62,7 @@ log_warning_msg () { fi } -log_warning_msg_nn () { +log_warning_msg_nn() { if _have_tput ; then YELLOW="$("$TPUT" setaf 3)" printf " ${BLUE}*${NORMAL} $@" @@ -72,14 +72,14 @@ log_warning_msg_nn () { } # int log_begin_message (char *message) -log_begin_msg () { +log_begin_msg() { if [ "$#" -eq 0 ]; then return 1 fi printf " ${GREEN}*${NORMAL} $@\n" } -log_begin_msg_nn () { +log_begin_msg_nn() { if [ "$#" -eq 0 ]; then return 1 fi @@ -90,7 +90,7 @@ log_begin_msg_nn () { SUBMSG=" ${GREEN}-${NORMAL} " # int log_end_message (int exitstatus) -log_end_msg () { +log_end_msg() { # If no arguments were passed, return [ "$#" -eq 0 ] && return 1 @@ -167,23 +167,6 @@ RC_DEFAULT_INDENT=2 #RC_DOT_PATTERN=' .' RC_DOT_PATTERN='' -# void splash(...) -# -# Notify bootsplash/splashutils/gensplash/whatever about -# important events. -# -splash() { - return 0 -} - -# void profiling(...) -# -# Notify bootsplash/whatever about important events. -# -profiling() { - return 0 -} - # void get_bootconfig() # # Get the BOOTLEVEL and SOFTLEVEL by setting @@ -221,19 +204,6 @@ get_bootconfig() { return 0 } -# void get_libdir(void) -# -# prints the current libdir {lib,lib32,lib64} -# -get_libdir() { - if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then - CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}" - elif [ -x "/usr/bin/portageq" ] ; then - CONF_LIBDIR="$(/usr/bin/portageq envvar CONF_LIBDIR)" - fi - printf '%s\n' ${CONF_LIBDIR:=lib} -} - # void esyslog(char* priority, char* tag, char* message) # # use the system logger to log a message @@ -435,22 +405,6 @@ ewend() { return $retval } -# v-e-commands honor RC_VERBOSE which defaults to no. -# The condition is negated so the return value will be zero. -veinfo() { [ "${RC_VERBOSE}" != "yes" ] || einfo "$@"; } -veinfon() { [ "${RC_VERBOSE}" != "yes" ] || einfon "$@"; } -vewarn() { [ "${RC_VERBOSE}" != "yes" ] || ewarn "$@"; } -veerror() { [ "${RC_VERBOSE}" != "yes" ] || eerror "$@"; } -vebegin() { [ "${RC_VERBOSE}" != "yes" ] || ebegin "$@"; } -veend() { - [ "${RC_VERBOSE}" = "yes" ] && { eend "$@"; return $?; } - return ${1:-0} -} -veend() { - [ "${RC_VERBOSE}" = "yes" ] && { ewend "$@"; return $?; } - return ${1:-0} -} - # bool get_bootparam(param) # # return 0 if gentoo=param was passed to the kernel @@ -503,57 +457,6 @@ add_suffix() { return 0 } -# Network filesystems list for common use in rc-scripts. -# This variable is used in is_net_fs and other places such as -# localmount. -NET_FS_LIST="afs cifs coda gfs ncpfs nfs nfs4 shfs smbfs" - -# bool is_net_fs(path) -# -# return 0 if path is the mountpoint of a networked filesystem -# -# EXAMPLE: if is_net_fs / ; then ... -# -is_net_fs() { - local fstype - # /proc/mounts is always accurate but may not always be available - if [ -e /proc/mounts ]; then - fstype="$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' /proc/mounts )" - else - fstype="$( mount | sed -n -e 's:.* on '"$1"' type \([^ ]*\).*:\1:p' )" - fi - case " ${NET_FS_LIST} " in - *" ${fstype} "*) - return 0 - ;; - *) - return 1 - ;; - esac -} - -# bool is_uml_sys() -# -# return 0 if the currently running system is User Mode Linux -# -# EXAMPLE: if is_uml_sys ; then ... -# -is_uml_sys() { - grep -qs 'UML' /proc/cpuinfo - return $? -} - -# bool is_vserver_sys() -# -# return 0 if the currently running system is a Linux VServer -# -# EXAMPLE: if is_vserver_sys ; then ... -# -is_vserver_sys() { - grep -qs '^s_context:[[:space:]]*[1-9]' /proc/self/status - return $? -} - # bool get_mount_fstab(path) # # return the parameters to pass to the mount command generated from fstab