#!/sbin/openrc-run
#
# SPDX-License-Identifier: GPL-3.0-or-later
# myMPD (c) 2018-2026 Juergen Mang <mail@jcgames.de>
# https://github.com/jcorporation/mympd

name=myMPD
command="@CMAKE_INSTALL_FULL_BINDIR@/mympd"
command_args="-s"
command_background="yes"
command_user="mympd:mympd"
capabilities="^cap_net_bind_service"

start_stop_daemon_args=""
pidfile="/run/$name.pid"

depend() {
    need net
    after firewall
}

start_pre() {
    checkpath -d -m 770 -o mympd:mympd /var/lib/mympd
    checkpath -d -m 770 -o mympd:mympd /var/cache/mympd
}
