Changeset 2820

Show
Ignore:
Timestamp:
01/01/05 13:05:17 (4 years ago)
Author:
khali
Message:

Axel Thimm's cleanups:
o removed bashisms

  • make proper redirects to /dev/null
  • no bash-i18n

o no attempt to start lm_sensors is no config file or no modules in the

config file

o removed leading and trailing underscores of displayed module names

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/prog/init/lm_sensors.init

    r2776 r2820  
    3737if [ $WITHSYS == "0" ]; then 
    3838        # If sensors isn't supported by the kernel, try loading the module... 
    39         [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc &>/dev/null 
     39        [ -e /proc/sys/dev/sensors ] || /sbin/modprobe i2c-proc >/dev/null 2>&1 
    4040 
    4141        # Don't bother if /proc/sensors still doesn't exist, kernel doesn't have 
     
    4444 
    4545        # If sensors was not already running, unload the module... 
    46         [ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null 
     46        [ -e /var/lock/subsys/lm_sensors ] || /sbin/modprobe -r i2c-proc >/dev/null 2>&1 
    4747fi 
    4848 
    4949CONFIG=/etc/sysconfig/lm_sensors 
     50[ -r "$CONFIG" ] || exit 0 
     51grep '^MODULE_' $CONFIG >/dev/null 2>&1 || exit 0 
     52 
     53# Load config file 
     54. "$CONFIG" 
     55 
    5056PSENSORS=/usr/local/bin/sensors 
    5157 
     
    5864 
    5965RETVAL=0 
     66prog="lm_sensors" 
    6067 
    6168start() { 
    62         echo -n $"Starting up sensors: " 
    63         test -r "$CONFIG" && . "$CONFIG" 
     69        echo -n "Starting $prog: loading module " 
    6470 
    6571        modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` 
     
    6773        while [ $i -lt $modules ] ; do 
    6874                module=`eval echo '$'MODULE_$i` 
    69                 echo starting module __${module}__ 
    70                 /sbin/modprobe $module &>/dev/null 
     75                echo -n "${module} " 
     76                /sbin/modprobe $module >/dev/null 2>&1 
    7177                i=`expr $i + 1` 
    7278        done 
     
    8490 
    8591stop() { 
    86         echo -n $"Shutting down sensors: " 
    87         test -r "$CONFIG" && . "$CONFIG" 
     92        echo -n "Stopping $prog: " 
    8893 
    8994        modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` 
     
    9196        while [ $i -ge 0 ] ; do 
    9297                module=`eval echo '$'MODULE_$i` 
    93                 /sbin/modprobe -r $module &>/dev/null 
     98                /sbin/modprobe -r $module >/dev/null 2>&1 
    9499                i=`expr $i - 1` 
    95100        done 
    96101 
    97102        if [ $WITHSYS == "0" ]; then 
    98                 /sbin/modprobe -r i2c-proc &>/dev/null 
     103                /sbin/modprobe -r i2c-proc >/dev/null 2>&1 
    99104        fi 
    100105 
     
    142147        ;; 
    143148  *) 
    144         echo "Usage: sensors.init {start|stop|status|restart|reload|condrestart}" 
     149        echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" 
    145150        exit 1 
    146151esac