containers-mmmonit/mmmonitd.sh

21 lines
374 B
Bash
Raw Normal View History

2022-03-14 21:14:24 +00:00
#!/bin/sh
set -e
dir=${DIR:-/srv}
pid=/run/mmmonit.pid
# TODO: Log to syslog
log=${dir}/mmmonit.log
usr=${USER:-nobody}
case $1 in
start)
chown -R ${usr}:${usr} ${dir}
2022-03-15 21:37:05 +00:00
daemonize -a -e ${log} -o ${log} -c ${dir} -p ${pid} -l ${pid} -u ${usr} /usr/bin/mmmonit -b :: -p 3000
2022-03-14 21:14:24 +00:00
;;
stop)
test -f ${pid} || exit 0
cat ${pid} | xargs -r kill
;;
esac