diff options
Diffstat (limited to 'mines-of-titan/debian/mines-of-titan/usr/bin/mines-of-titan')
-rwxr-xr-x | mines-of-titan/debian/mines-of-titan/usr/bin/mines-of-titan | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mines-of-titan/debian/mines-of-titan/usr/bin/mines-of-titan b/mines-of-titan/debian/mines-of-titan/usr/bin/mines-of-titan new file mode 100755 index 0000000..1d2b3ad --- /dev/null +++ b/mines-of-titan/debian/mines-of-titan/usr/bin/mines-of-titan @@ -0,0 +1,31 @@ +#!/bin/sh +# File: /usr/bin/mines-of-titan +# Author: bgstack15 +# Startdate: 2019-08-31 11:59 +# Title: Mines of Titan +# Package: mines-of-titan +# Purpose: Runs MINES from the correct location +# History: +# Usage: Normally called by /usr/share/applications/mines-of-titan.desktop +# Reference: +# https://stackoverflow.com/questions/2924697/how-does-one-output-bold-text-in-bash +# Improve: +# Documentation: +# Dependencies: +# file /etc/default/mines-of-titan + +# load variables from defaults file +test -r "/etc/default/mines-of-titan" && . /etc/default/mines-of-titan 1>/dev/null 2>&1 +test -z "${MOT_SRC_DIR}" && MOT_SRC_DIR=/usr/share/mines-of-titan +test -z "${MOT_PLAY_DIR}" && MOT_PLAY_DIR=~/.dosbox/mot + +# 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 "${MOT_PLAY_DIR}" 2>/dev/null +chmod 0700 "${MOT_PLAY_DIR}" +cp -prn "${MOT_SRC_DIR}"/* "${MOT_PLAY_DIR}" +chmod 0600 "${MOT_PLAY_DIR}"/* +chmod 0700 "${MOT_PLAY_DIR}"/*.sh + +# start game +cd "${MOT_PLAY_DIR}" +sh ./mines.sh |