summaryrefslogtreecommitdiff
path: root/games/mangband/mangband.sh
diff options
context:
space:
mode:
Diffstat (limited to 'games/mangband/mangband.sh')
-rw-r--r--games/mangband/mangband.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/games/mangband/mangband.sh b/games/mangband/mangband.sh
new file mode 100644
index 0000000000..717bc06fae
--- /dev/null
+++ b/games/mangband/mangband.sh
@@ -0,0 +1,32 @@
+# #!/bin/sh
+
+GAMES_MANGBAND=/usr/share/games/mangband
+
+if [ ! -e ${HOME}/.mangband ]; then
+ mkdir -p ${HOME}/.mangband
+
+ # Make a copy of the lib directory for the user
+ cp -R ${GAMES_MANGBAND}/lib ${HOME}/.mangband/
+
+ # Server configuration files
+ cp ${GAMES_MANGBAND}/mangband.cfg ${HOME}/.mangband/
+
+ # Create an account file
+ #touch ${HOME}/.mangband/mangband.acc
+
+ # Create links for running the server in ${HOME}/.mangband
+fi
+
+cd ${HOME}/.mangband
+
+# Point $MANGBAND_PATH to the local lib directory
+export MANGBAND_PATH=${HOME}/.mangband/lib
+
+case $(basename $0) in
+ mangband)
+ exec ${GAMES_MANGBAND}/mangclient "$@"
+ ;;
+ mangband.server)
+ exec ${GAMES_MANGBAND}/runserv "$@"
+ ;;
+ esac