summaryrefslogtreecommitdiffstats
path: root/noise/modules/temp
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2013-12-09 22:04:23 +0100
committermakefu <github@syntax-fehler.de>2013-12-09 22:04:23 +0100
commit6755676db22c82806763f19e7654c2f7c03279c2 (patch)
tree8317c4c9d67b776681e3005a91bd0548d0e7d8db /noise/modules/temp
parent1a49b2e844a733812be1de8fc76af1a4c2ec5f0e (diff)
parentf4f5b3b7aff2ac45ee035f54d6e8899ff963d133 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'noise/modules/temp')
-rwxr-xr-xnoise/modules/temp50
1 files changed, 0 insertions, 50 deletions
diff --git a/noise/modules/temp b/noise/modules/temp
deleted file mode 100755
index a11c3720..00000000
--- a/noise/modules/temp
+++ /dev/null
@@ -1,50 +0,0 @@
-#! /bin/bash
-
-temper=/krebs/temper/temper
-
-main() {
- case "${1--K}" in
- (--help)
- echo "report temperature in K, °C, °R, or °F."
- exit
- ;;
- (-C|--celsius) unit='Grad Zelsius' ; formula='x - 273.15' ;;
- (-F|--fahrenheit) unit='Grad Fahrenheit'; formula='x * 9/5 - 459.67' ;;
- (-R|--rankine) unit='Grad Renkin' ; formula='x * 9/5' ;;
- (-K|--kelvin) unit='Kelvin' ; formula='x' ;;
- (*)
- echo 'Error 1: you are made of stupid!'
- exit 23
- ;;
- esac
- if test -f $temper -a -x $temper; then
- espeak_inside `inside_temp "$formula"` $unit
- fi
- espeak_outside `outside_temp "$formula"` $unit
-}
-
-## temp [<formula with temperature as x>]
-## Echo temperature in K. If formula is given then return that result instead.
-inside_temp() {
- echo "scale=2; x=`$temper` + 273.15; ${1-x}" | bc
-}
-
-outside_temp() {
- echo "scale=2; x=`dig +short txt outside.elwood.temp.citecs.de |
- sed 's/^"DEG \([0-9]\+\.[0-9]\+\)"$/\1/'
- ` + 273.15; ${1-x}" | bc
-}
-
-espeak_inside() { echo Die Krebs-tempera-tur beträgt $@ | to_espeak; }
-espeak_outside() { echo Die Außen-tempera-tur beträgt $@ | to_espeak; }
-
-to_espeak() {
- sed '
- s/\(\.[0-9]\)0\+/\1/g
- s/\(\.[0-9]\)\([0-9]\)[0-9]*/ \1 \2 /;
- s/^-/minus /;
- s/\./ komma /;
- ' | tee $NOISE_linefeed
-}
-
-main "$@"