Shellskripts

Mit hilfe dieser Shellskripts wird
die Startseite alle 10 Sekunden aktualisiert:

html_erzeuger.sh

#!/bin/sh

cd /usr/lib/DHT22/wiringPi/lol_dht22

date > /home/pi/weatherstation/wetter.log
sudo ./loldht 7 | grep *C >> /home/pi/weatherstation/wetter.log

cd /home/pi/weatherstation
HTML_DATEN=`cat wetter.log`

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
echo ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="de">'

echo " <head>"<
echo " <title>Supernova Wetterdaten 05/2017 </title>"
echo ' <style type="text/css">'
echo ' h1 {font-size: 40px; font-family: rockwell}'
echo ' h2 {font-family: rockwell}'
echo ' </style>'
echo " </head>"

echo ' <body style="background-color:#dd9000;">'
echo " <h1>Supernova</h1>"
echo ' <h2>Hier finden Sie die aktuellen Daten aus meinem Zimmer:</h2>'
echo " <p>"
echo $HTML_DATEN
echo " </p>"
echo ' <hr/>'
echo " </body>"
echo "</html>"



#!/bin/sh

while :; do

./html_erzeuger.sh > index.html 2>fehler.log

echo "\$ uploadtest" | ftp supernova.w4f.eu > /tmp/ftp_wetter.log

sleep 10
done


Startseite