diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2017-01-14 02:03:46 +0100 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2017-01-14 05:49:21 +0100 |
commit | 2335ad51d617beda945170956d31f29c4631d25e (patch) | |
tree | d6d074e6a406ee2b622d08f15db3e5200ee89f86 /net/vallumd/files | |
parent | 8ffe6f474f7018df1a767524bc0d1957eee64891 (diff) |
vallumd: new package
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat (limited to 'net/vallumd/files')
-rw-r--r-- | net/vallumd/files/vallumd.conf | 6 | ||||
-rw-r--r-- | net/vallumd/files/vallumd.init | 34 |
2 files changed, 40 insertions, 0 deletions
diff --git a/net/vallumd/files/vallumd.conf b/net/vallumd/files/vallumd.conf new file mode 100644 index 000000000..75703abb7 --- /dev/null +++ b/net/vallumd/files/vallumd.conf @@ -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 diff --git a/net/vallumd/files/vallumd.init b/net/vallumd/files/vallumd.init new file mode 100644 index 000000000..d0cb78150 --- /dev/null +++ b/net/vallumd/files/vallumd.init @@ -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 +} |