Code: Select all
#!/bin/bash
base="http://192.168.1.13:80/core/api/jeeApi.php?api="
key="xxxxxxxxxxx"
type="virtual"
diaactual=`date +%d`
mesactual=`date +%m`
anyoactual=`date +%Y`
watios=$(sqlite3 -csv eagleowl.db "select year||'-'||substr('0'||month,-2,2)||'-'||substr('0'||day,-2,2)||' '||substr('0'||hour,-2,2)||':'||substr('0'||min,-2,2) date,$
a="$(echo "$watios" | cut -c 20-)"
echo $a
c="$(echo $watios| cut -c2-11)"
echo $c
intensidad=$(sqlite3 -csv eagleowl.db "select year||'-'||substr('0'||month,-2,2)||'-'||substr('0'||day,-2,2)||' '||substr('0'||hour,-2,2)||':'||substr('0'||min,-2,2) d$
b="$(echo "$intensidad" | cut -c 20-)"
echo $b
hora=$(sqlite3 -csv eagleowl.db "select hour||':'||substr('0'||min,-2,2) date,cast(round(60*ch1_kw_avg) as int) w from energy_history where year=$anyoactual and month=$
#print $medida
d="$(echo $hora | cut -c1-4)"
echo $d
urla="$base$key&type=$type&id=5999&value=$a"
URLa=${urla%$'\r'}
echo $URLa
curl $URLa
Code: Select all
watios2.sh: line 23: unexpected EOF while looking for matching `"'
watios2.sh: line 28: syntax error: unexpected end of fileAny suggestion?