forked from snaptec/openWB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.sh
executable file
·27 lines (21 loc) · 994 Bytes
/
main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
. /var/www/html/openWB/openwb.conf
ikwh=$(cat /run/shm/em-$smaemdbezugid-pregardcounter)
ekwh=$(cat /run/shm/em-$smaemdbezugid-psurpluscounter)
bezuga1=$(cat /run/shm/em-$smaemdbezugid-p1regard |sed 's/\..*$//')
bezuga2=$(cat /run/shm/em-$smaemdbezugid-p2regard |sed 's/\..*$//')
bezuga3=$(cat /run/shm/em-$smaemdbezugid-p3regard |sed 's/\..*$//')
wattbezug=$(cat /run/shm/em-$smaemdbezugid-pregard |sed 's/\..*$//')
watteinspeisung=$(cat /run/shm/em-$smaemdbezugid-psurplus |sed 's/\..*$//')
ikwh=$(echo "($ikwh*1000)" |bc)
ekwh=$(echo "($ekwh*1000)" |bc)
echo $ikwh > /var/www/html/openWB/ramdisk/bezugkwh
echo $ekwh > /var/www/html/openWB/ramdisk/einspeisungkwh
echo $bezuga1 > /var/www/html/openWB/ramdisk/bezuga1
echo $bezuga2 > /var/www/html/openWB/ramdisk/bezuga2
echo $bezuga3 > /var/www/html/openWB/ramdisk/bezuga3
if (( $watteinspeisung > 5 ));then
wattbezug=$(echo -$watteinspeisung)
fi
echo $wattbezug
echo $wattbezug > /var/www/html/openWB/ramdisk/wattbezug