diff options
Diffstat (limited to 'run-instance.sh')
-rwxr-xr-x | run-instance.sh | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/run-instance.sh b/run-instance.sh index 2cdfad9..74fc883 100755 --- a/run-instance.sh +++ b/run-instance.sh @@ -1,26 +1,5 @@ #!/bin/bash -################# -# Configuration # -################# - -DEBUG=1 - -# The root directory. -PREFIX="/home/tremded" - -# fs_basepath, fs_homepath and fs_game. -COMMON="$PREFIX/common" -HOME_PREFIX="$PREFIX/home@" -FS_GAME="slacker" - -# Config directory. -CONFIG_PREFIX="$PREFIX/config/" - -# Executables. -GDB_WRAPPER="$PREFIX/bin/gdb-wrapper2.sh" -TREMDED_PREFIX="$PREFIX/bin/tremded@" - #################### # Helper functions # #################### @@ -55,6 +34,29 @@ function check_dir { [ -d "$1" ] || error "%s '%s' is not a directory\n" "$2" "$1" } +################# +# Configuration # +################# + +# Load the script configuration and set some defaults. +source run-instance.local.sh || error "missing config\n" +[ -z "$PREFIX" ] && error "PREFIX is not set\n" + +# fs_basepath, fs_homepath and fs_game. +true ${COMMON:="$PREFIX/common"} +true ${HOME_PREFIX:="$PREFIX/home@"} +true ${FS_GAME:="slacker"} + +# Config directory. +true ${CONFIG_PREFIX:="$PREFIX/config/"} + +# Executables. +true ${GDB_WRAPPER:="$PREFIX/bin/gdb-wrapper2.sh"} +true ${TREMDED_PREFIX:="$PREFIX/bin/tremded@"} + +# Debugging +true ${DEBUG:=1} + ################### # The entry point # ################### |