You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
429 B
Bash
24 lines
429 B
Bash
#!/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
|
|
}
|