#!/bin/sh /etc/rc.common # should run after S96plc START=97 STOP=10 PIDFILE=/var/run/simpleconnect.pid config_load plc config_get PLC plc interface 'br-lan' start() { start-stop-daemon -S -x sh -m -b -p $PIDFILE -- -c \ "trap \"trap - TERM; kill 0; exit\" TERM while true; do plcgpio -i $PLC | awk -f /usr/share/plc/simpleconnect.awk & wait \$! sleep 5 done" } stop() { start-stop-daemon -K -p $PIDFILE }