"Fossies" - the Fresh Open Source Software Archive

Member "mosshe/__ideen_helper_scripts.txt" (27 Jan 2019, 794 Bytes) of package /linux/privat/old/mosshe.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ::::::::::::::
    2 read_apcupsd.sh
    3 ::::::::::::::
    4 #!/bin/bash
    5 
    6 if ! [ -x /usr/bin/apcaccess ]; then
    7     exit 55555
    8 else
    9     RTN=$( apcaccess -h 127.0.0.1 | fgrep $1 | cut -d ':' -f 2 | cut -d ' ' -f 2 | cut -d '.' -f 1 )
   10     echo $RTN
   11     exit $RTN
   12 fi
   13 
   14 ::::::::::::::
   15 read_hardware_sensor.sh
   16 ::::::::::::::
   17 #!/bin/bash
   18 
   19 if ! [ -x /usr/bin/sensors ]; then
   20     exit 55555
   21 else
   22     RTN=$( /usr/bin/sensors | grep "^${1}:" | cut -d ":" -f 2 | sed -e "s/^ *//g" | cut -d "." -f 1 | cut -d " " -f 1 | sed -e "s/\+//g" )
   23     echo $RTN
   24     exit $RTN
   25 fi
   26 ::::::::::::::
   27 read_smartmon.sh
   28 ::::::::::::::
   29 #!/bin/bash
   30 
   31 if ! [ -x /usr/sbin/smartctl ]; then
   32     RTN=55555
   33 else
   34     RTN=$( /usr/sbin/smartctl -A "$1" | fgrep "$2" | sed -e "s/  */ /g" | sed -e "s/^ *//g" | cut -d ' ' -f 10 )
   35 fi
   36 
   37 echo $RTN
   38 exit $RTN