aboutsummaryrefslogtreecommitdiff
path: root/beyond-the-titanic
diff options
context:
space:
mode:
Diffstat (limited to 'beyond-the-titanic')
-rw-r--r--beyond-the-titanic14
1 files changed, 11 insertions, 3 deletions
diff --git a/beyond-the-titanic b/beyond-the-titanic
index 6a1ce22..867fec0 100644
--- a/beyond-the-titanic
+++ b/beyond-the-titanic
@@ -17,14 +17,22 @@
# load variables from defaults file
test -r "/etc/default/beyond-the-titanic" && . /etc/default/beyond-the-titanic 1>/dev/null 2>&1
-test -z "${BEYOND_DIR}" && BEYOND_DIR=/usr/share/beyond-the-titanic
+test -z "${BEYOND_SRC_DIR}" && BEYOND_SRC_DIR=/usr/share/beyond-the-titanic
+test -z "${BEYOND_PLAY_DIR}" && BEYOND_PLAY_DIR=~/.local/share/beyond-the-titanic
+
+# prepare play directory, because the game needs write access to the data files, as well as to the directory for saving the game
+mkdir -p "${BEYOND_PLAY_DIR}" 2>/dev/null
+chmod 0700 "${BEYOND_PLAY_DIR}"
+cp -pr "${BEYOND_SRC_DIR}"/* "${BEYOND_PLAY_DIR}"
+chmod 0600 "${BEYOND_PLAY_DIR}"/*
+chmod 0700 "${BEYOND_PLAY_DIR}/BEYOND"
# warn about screen size if not correct
if test -z "${BEYOND_SILENT}" ;
then
___cols="$( tput cols 2>/dev/null )"
___lines="$( tput lines 2>/dev/null )"
- if "${___cols}" != "80" || "${___lines}" != "24" ;
+ if test "${___cols}" != "80" || test "${___lines}" != "24" ;
then
printf "The game recommends using a terminal size of exactly 80 columns by 24 lines. Set BEYOND_SILENT=1 to suppress this message.\nPress enter to continue. "
read ___foo ;
@@ -32,7 +40,7 @@ then
fi
# start game
-cd "${BEYOND_DIR}"
+cd "${BEYOND_PLAY_DIR}"
./BEYOND
# return terminal text to normal style
bgstack15