vallumd: new package

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel
2017-01-14 02:03:46 +01:00
parent 8ffe6f474f
commit 2335ad51d6
3 changed files with 89 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
config vallumd mqtt
option host 127.0.0.1
option port 1883
list topics blacklist4
list topics blacklist6
option enabled 0
+34
View File
@@ -0,0 +1,34 @@
#!/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
}