You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
649 B

#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
PROG=/usr/sbin/vallumd
add_topic() {
procd_append_param command -t "$1"
}
start_service() {
local enabled
local mqtt_host
local mqtt_port
config_load "vallumd"
config_get_bool enabled "mqtt" "enabled" 1
[ "$enabled" -gt 0 ] || return 1
config_get mqtt_host "mqtt" "host"
config_get mqtt_port "mqtt" "port"
procd_open_instance
procd_set_param command $PROG
[ -n "$mqtt_host" ] && procd_append_param command -h "$mqtt_host"
[ -n "$mqtt_port" ] && procd_append_param command -p "$mqtt_port"
config_list_foreach mqtt topics add_topic
procd_set_param respawn
procd_close_instance
}