start()
{
- sqlite3 /home/bdsm/bdsm.sqlite3 "SELECT 1 FROM MEASUREMENTS"
+ sqlite3 /home/bdsm/bdsm.sqlite3 "SELECT 1 FROM MEASUREMENTS" 2>/dev/null 1>&2
if [ $? -eq 1 ]; then
sqlite3 /home/bdsm/bdsm.sqlite3 \
"CREATE TABLE MEASUREMENTS(\
cat /home/bdsm/in.fifo | awk -F'|' '{ \
printf("INSERT INTO MEASUREMENTS(timestamp,host,attribute,value) \
VALUES (%s,\"%s\", \"%s\", \"%s\");\n",$1,$2, $3, $4) }' | \
- sqlite3 bdsm.sqlite3
+ sqlite3 bdsm.sqlite3 &
echo $! > /home/bdsm/.processor.pid
}