#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
        need net
}

run_dir="/opt/sonar"
command="/opt/sonar/bin/linux-multiarch.sh"
etc_dir="/etc/sonarqube"

start() {
	ebegin "Starting SonarQube"

        start-stop-daemon --start --background -u ${USER} -g ${GROUP} \
		--exec ${command} -- --daemon
        eend $?
}

stop() {
        ebegin "Stopping SonarQube"
        start-stop-daemon --stop --name wrapper --retry 15
        eend $?
}
