Skip to content

Commit

Permalink
Merge pull request #107 from sandain/master
Browse files Browse the repository at this point in the history
Display the correct program name
  • Loading branch information
sandain committed Jan 11, 2016
2 parents 713dc98 + fa6ff3a commit b64b4ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mscs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# This is a wrapper to msctl that imitates traditional mscs behaviour:
# uses the same default user, config file and location.

# Get executable name
PROG=$(basename $0)

# Load the mscs default file if it exists.
MSCS_DEFAULTS="/etc/default/mscs"
if [ -r $MSCS_DEFAULTS ]; then
Expand All @@ -26,7 +29,7 @@ USER_NAME=${USER_NAME:-minecraft}
LOCATION=${LOCATION:-"/opt/mscs"}

# Setup the arguments to the msctl script.
MSCS_ARGS="$MSCS_ARGS-l $LOCATION $@"
MSCS_ARGS="-p $PROG -l $LOCATION $MSCS_ARGS $@"

# Run the msctl script.
if [ "$USER_NAME" = "$(whoami)" ]; then
Expand Down
9 changes: 9 additions & 0 deletions msctl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ EOF
# ---------------------------------------------------------------------------
while [ "$1" != "${1#-}" ]; do
case "$1" in
-p)
if [ -n "$2" ]; then
PROG="$2"
shift
else
echo "$PROG: '-p' needs a program name argument."
exit 1
fi
;;
-c)
if [ -n "$2" ]; then
MSCS_DEFAULTS_CL="$2"
Expand Down

0 comments on commit b64b4ef

Please sign in to comment.