#!/bin/sh

piddir="/opt/local/var/run/netdata/netdata.pid"
pidfile="${piddir}/netdata.pid"

command="/opt/local/sbin/netdata"
command_args="-P ${pidfile} -D"

[ ! -d "${piddir}" ] && mkdir -p "${piddir}"
chown -R netdata "${piddir}"

exec ${command} ${command_args}
