#!/bin/bash hddtemp=`sudo /usr/sbin/hddtemp -n /dev/sda` cputemp=`/usr/bin/sensors | grep "CPU Temp" | cut -d"+" -f2 | cut -b1-4` systemp=`/usr/bin/sensors | grep "Sys Temp" | cut -d"+" -f2 | cut -b1-4` hostname=`cat /etc/hostname` if [ ! "$1" = "-sms" ] then echo -e "Aussensensoren werden gemessen" fi temp_extern=`sudo /usr/bin/digitemp -aq -o 2 -c /usr/local/bin/.digitemprc` raumtemperatur=`echo $temp_extern | cut -d" " -f2` aussentemperatur=`echo $temp_extern | cut -d" " -f3` gehaeusetemperatur=`echo $temp_extern | cut -d" " -f4` schranktemperatur=`echo $temp_extern | cut -d" " -f5` if [ "$1" = "-sms" ] then echo "HD: $hddtemp.0; CPU: $cputemp; System: $systemp; IN: $raumtemperatur; OUT: $aussentemperatur; Case: $gehaeusetemperatur; Schrank: $schranktemperatur" else echo -e "\n $hostname's Temperaturen" echo -e "--------------------------" echo -e "Festplatte:\t$hddtemp.0°C" echo -e "CPU:\t\t$cputemp°C" echo -e "System:\t\t$systemp°C\n" echo -e "Drinnen:\t$raumtemperatur°C" echo -e "Draussen:\t$aussentemperatur°C" echo -e "im Gehaeuse:\t$gehaeusetemperatur°C" echo -e "Schrank:\t$schranktemperatur°C\n" fi