#!/bin/sh #------------------------------------------------------------------------------ # opt/files/srv/www/admin/soekris.cgi __FLI4LVER__ # # Creation: gdw # Last Update: $Id$ #------------------------------------------------------------------------------ . /srv/www/include/cgi-helper #Security check_rights 'embedded' 'view' . /var/run/embedded.conf i2c_get_temperature show_html_header 'Soekris' show_tab_header 'Temperatur und Spannung' no value0='Temp Vcc VPWR +12V -12V GND Vsb Vdd Vbat AVdd' if [ -f /proc/driver/soekris_temp ]; then value2=`cat /proc/driver/soekris_voltage | cut -d' ' -f2` value2=`echo $value2 | cut -d' ' -f3-11` else soekris_io_path='/sys/class/hwmon/hwmon0/device' value2='' # # Scalierung der einzelnen Spannungen # value3='0 20 201 48 48 10 20 20 10 20' for i in `seq 2 10`; do value1=`cat $soekris_io_path/in$i\_input|cut -d' ' -f1` value2="$value2 `echo $(expr '(' $value1 '*' $( echo $value3|cut -d' ' -f$i ) + 50 ')' '/' 100 )| sed 's/\([0-9]\{2\}\)$/.\1/'`" done fi echo "
$x | " done echo "|
---|---|
$temperature °C | " for x in $value2; do echo "$x V | " done echo '