mirror of https://github.com/ericonr/sndio.git
68 lines
1.6 KiB
Bash
68 lines
1.6 KiB
Bash
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: sndiod
|
|
# Required-Start: $local_fs $network $remote_fs
|
|
# Required-Stop: $local_fs $network $remote_fs
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: sndio audio and MIDI server
|
|
# Description: sndiod provides audio and MIDI services for sndio-supporting applications
|
|
### END INIT INFO
|
|
|
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
|
DESC="sndio audio and MIDI server"
|
|
NAME="sndiod"
|
|
DAEMON=@bindir@/sndiod
|
|
DAEMON_OPTS=""
|
|
SCRIPTNAME=/etc/init.d/$NAME
|
|
|
|
# Exit if the package is not installed
|
|
[ -x "$DAEMON" ] || exit 0
|
|
|
|
# Read configuration variable file if it is present
|
|
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
|
|
|
# Load the VERBOSE setting and other rcS variables
|
|
. /lib/init/vars.sh
|
|
|
|
# Define LSB log_* functions.
|
|
. /lib/lsb/init-functions
|
|
|
|
case "$1" in
|
|
start)
|
|
log_daemon_msg "Starting $DESC" "$NAME"
|
|
start-stop-daemon --start --quiet --oknodo \
|
|
--exec $DAEMON -- $DAEMON_OPTS
|
|
log_end_msg $?
|
|
;;
|
|
stop)
|
|
log_daemon_msg "Stopping $DESC" "$NAME"
|
|
start-stop-daemon --stop --quiet --oknodo \
|
|
--exec $DAEMON
|
|
log_end_msg $?
|
|
;;
|
|
status)
|
|
if start-stop-daemon --status --exec $DAEMON; then
|
|
log_success_msg "$NAME is running"
|
|
exit 0
|
|
else
|
|
log_failure_msg "$NAME is not running"
|
|
exit 1
|
|
fi
|
|
;;
|
|
restart|force-reload)
|
|
log_daemon_msg "Restarting $DESC" "$NAME"
|
|
start-stop-daemon --stop --quiet --oknodo \
|
|
--exec $DAEMON
|
|
start-stop-daemon --start --quiet --oknodo \
|
|
--exec $DAEMON -- $DAEMON_OPTS
|
|
log_end_msg $?
|
|
;;
|
|
*)
|
|
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
|
exit 3
|
|
;;
|
|
esac
|
|
|
|
:
|