#!/bin/sh
### BEGIN INIT INFO
# Provides:          nexusd
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start nexus daemon at boot time
# Description:       Enable nexus to run as a system service provided by daemon.
### END INIT INFO

NEXUS_HOME="/home/pi/nexus/nexus-${version-number-latest-nexus-repo-release-number}"
NEXUS_USER="pi"

. /lib/lsb/init-functions
log_daemon_msg "Nexus daemon called with: $@" "nexusd"

exec sudo -u "$NEXUS_USER" -- "$NEXUS_HOME/bin/nexus" "$@"

log_end_msg $?
