#!/bin/sh
#
# Syntax:
#   cat knxLog | parseLog > script.sh
#
# (you probably need to change in this script to suite your need)
# remove group addresses starting with 0/3 and 0/0
# the 0/1/1 presents the time each minute
#
# Author: Johan Ekblad 
# License: GNU GPL v2


grep -v "to 0/3" | grep -v "to 0/0/" | awk '{if ($5=="0/1/1:") {last=$7;getline;while($7==last){lnr=NR;getline;if (NR==lnr) break;}if (60-s>0) {print "sleep "60-s;}s=0;}else{print "groupswrite ip:127.0.0.1 "substr($5,0,length($5)-1)" "$6";sleep 1";s++}}'

