summaryrefslogtreecommitdiffstats
path: root/utils/rtl_433/files/rtl_433.init
blob: 6fd94c3ec1658d2b7452622dae43da2de1f5458c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh /etc/rc.common

START=90

USE_PROCD=1

PROG=/usr/bin/rtl_433

start_service() {
    config_load rtl_433

    local enabled
    config_get enabled rtl_433 enabled
    [ "$enabled" -gt 0 ] || return

    local flags
    config_get flags rtl_433 flags

    procd_open_instance
    config_list_foreach rtl_433 env "procd_append_param env"
    procd_set_param command $PROG $flags
    procd_set_param stdout 1
    procd_set_param stderr 1
    procd_close_instance
}

reload_service() {
    stop
    start
}

restart() {
    reload_service
}