Skip to content

Commit

Permalink
shellcheck launch scripts
Browse files Browse the repository at this point in the history
(thanks, dogerish)
  • Loading branch information
sauerbraten committed May 15, 2021
1 parent eb8f310 commit 9c7ac12
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions server.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# SAUER_DIR should refer to the directory in which Sauerbraten data files are placed.
#SAUER_DIR=~/sauerbraten
if [ -z ${SAUER_DIR} ]
if [ -z "${SAUER_DIR}" ]
then
if [ -x ~/sauerbraten-code ]
then
Expand All @@ -21,11 +21,11 @@ SAUER_OPTIONS="-q${HOME}/.p1xbraten -k${SAUER_DIR}"

# SYSTEM_NAME should be set to the name of your operating system.
#SYSTEM_NAME=Linux
SYSTEM_NAME=`uname -s`
SYSTEM_NAME=$(uname -s)

# MACHINE_NAME should be set to the name of your processor.
#MACHINE_NAME=i686
MACHINE_NAME=`uname -m`
MACHINE_NAME=$(uname -m)

case ${SYSTEM_NAME} in
Linux)
Expand All @@ -44,24 +44,24 @@ x86_64|amd64)
MACHINE_NAME=64_
;;
*)
if [ ${SYSTEM_NAME} != native_ ]
if [ "${SYSTEM_NAME}" != native_ ]
then
SYSTEM_NAME=native_
fi
MACHINE_NAME=
;;
esac

if [ -x ${SAUER_BIN}/native_server ]
if [ -x "${SAUER_BIN}/native_server" ]
then
SYSTEM_NAME=native_
MACHINE_NAME=
fi

if [ -x ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}server ]
if [ -x "${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}server" ]
then
#exec gdb --args ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}server ${SAUER_OPTIONS} "$@"
exec ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}server ${SAUER_OPTIONS} "$@"
exec "${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}server" ${SAUER_OPTIONS} "$@"
else
echo "Your platform does not have a pre-compiled Sauerbraten client."
echo "Please follow the following steps to build a native client:"
Expand Down
12 changes: 6 additions & 6 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# SAUER_DIR should refer to the directory in which Sauerbraten data files are placed.
#SAUER_DIR=~/sauerbraten
if [ -z ${SAUER_DIR} ]
if [ -z "${SAUER_DIR}" ]
then
if [ -x ~/sauerbraten-code ]
then
Expand All @@ -21,11 +21,11 @@ SAUER_OPTIONS="-q${HOME}/.p1xbraten -k${SAUER_DIR}"

# SYSTEM_NAME should be set to the name of your operating system.
#SYSTEM_NAME=Linux
SYSTEM_NAME=`uname -s`
SYSTEM_NAME=$(uname -s)

# MACHINE_NAME should be set to the name of your processor.
#MACHINE_NAME=i686
MACHINE_NAME=`uname -m`
MACHINE_NAME=$(uname -m)

case ${SYSTEM_NAME} in
Linux)
Expand Down Expand Up @@ -58,15 +58,15 @@ then
MACHINE_NAME=
fi

if [ ${XDG_SESSION_TYPE} == wayland ]
if [ "${XDG_SESSION_TYPE}" = wayland ]
then
export SDL_VIDEODRIVER=wayland
fi

if [ -x ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client ]
if [ -x "${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client" ]
then
#exec gdb --args ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client ${SAUER_OPTIONS} "$@"
exec ${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client ${SAUER_OPTIONS} "$@"
exec "${SAUER_BIN}/${SYSTEM_NAME}${MACHINE_NAME}client" ${SAUER_OPTIONS} "$@"
else
echo "Your platform does not have a pre-compiled Sauerbraten client."
echo "Please follow the following steps to build a native client:"
Expand Down

0 comments on commit 9c7ac12

Please sign in to comment.