#!/sbin/openrc-run

name="weatherstationd"
description="Weather station daemon (temperature/humidity/pressure + wind speed/direction) with MQTT and web UI"

command="/usr/bin/weatherstationd"
command_args="${WEATHERSTATIOND_ARGS:-yaml:/etc/weatherstationd/config.yaml}"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
output_log="/var/log/weatherstationd/weatherstationd.log"
error_log="/var/log/weatherstationd/weatherstationd.log"

depend() {
    need net
    use logger
    after firewall
}

start_pre() {
    checkpath -d -m 0755 /var/log/weatherstationd
    checkpath -d -m 0755 /etc/weatherstationd
}
