Add mopidyctl script and manpage

Copied from Debian package
This commit is contained in:
Stein Magnus Jodal 2014-12-27 13:13:31 +01:00
parent 243bf4acbc
commit 29c6e198b5
2 changed files with 41 additions and 0 deletions

24
extra/mopidyctl/mopidyctl Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
SELF=$(basename $0)
DAEMON="/usr/bin/mopidy"
DAEMON_USER="mopidy"
CONFIG_FILES="/usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf"
CMD="$DAEMON --config $CONFIG_FILES $@"
if [ $# -eq 0 ]; then
echo "Usage: $SELF [options]" 1>&2
echo "Examples:" 1>&2
echo " $SELF --help" 1>&2
echo " $SELF config" 1>&2
echo " $SELF local scan" 1>&2
exit 1
fi
if [ $(id -u) -ne 0 ]; then
echo "$SELF must be run as root" 1>&2
exit 2
fi
echo "Running \"$CMD\" as user $DAEMON_USER" 1>&2
su -s /bin/sh -c "$CMD" -- $DAEMON_USER

View File

@ -0,0 +1,17 @@
.\" Manpage for mopidyctl
.TH "MOPIDYCTL" "8" "October 11, 2014" "1.0" "mopidyctl"
.SH NAME
mopidyctl \- manage the Mopidy music server system service
.SH SYNOPSIS
.B mopidyctl
[any mopidy(1) option]
.SH DESCRIPTION
The \fBmopidyctl\fP command runs \fBmopidy\fP subcommands in the
same environment as the Mopidy system service is running in. That is, as the
same user and with the same config as the Mopidy system service is using.
.SH OPTIONS
mopidyctl(8) takes the same options as mopidy(1).
.SH SEE ALSO
mopidy(1)
.SH COPYRIGHT
2014, Stein Magnus Jodal and contributors