mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-28 03:01:54 +08:00
24 lines
699 B
Bash
Executable File
24 lines
699 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
START=11
|
|
USE_PROCD=1
|
|
PROG=/bin/event-handler
|
|
|
|
start_service() {
|
|
touch /etc/event_log
|
|
poe_gpio="$(uci -q get event-handler.@event-handler[0].poe_gpio)"
|
|
echo $poe_gpio > /sys/class/gpio/export
|
|
usb_gpio="$(uci -q get event-handler.@event-handler[0].usb_gpio)"
|
|
echo $usb_gpio > /sys/class/gpio/export
|
|
heat_gpio="$(uci -q get event-handler.@event-handler[0].heat_gpio)"
|
|
echo $heat_gpio > /sys/class/gpio/export
|
|
wd_gpio="$(uci -q get event-handler.@event-handler[0].wd_gpio)"
|
|
echo $wd_gpio > /sys/class/gpio/export
|
|
procd_open_instance
|
|
procd_set_param command "$PROG"
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
}
|