mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-29 13:00:32 +01:00
59e668ade2
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
34 lines
965 B
Bash
34 lines
965 B
Bash
#!/bin/sh
|
|
|
|
# wrapper script for domination, part of the SlackBuilds.org
|
|
# project. Written by B. Watson, licensed under the WTFPL.
|
|
|
|
# script is installed as domination and domination-swing, checks how
|
|
# it was called to know what java class to invoke.
|
|
|
|
PRGNAM=domination
|
|
USERDIR="$HOME/.$PRGNAM"
|
|
SHAREDIR="/usr/share/games/$PRGNAM"
|
|
|
|
# program expects to read this stuff from the current directory.
|
|
LINKS="Domination.jar help lib maps resources"
|
|
|
|
[ ! -e "$USERDIR" ] && mkdir -p "$USERDIR"
|
|
if ! cd "$USERDIR"; then
|
|
echo "$0: failed to create/change to $USERDIR" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
for dir in $LINKS; do
|
|
[ ! -e $dir ] && ln -s $SHAREDIR/$dir $dir
|
|
done
|
|
|
|
# program expects to write to this stuff in the current dir.
|
|
mkdir -p saves
|
|
[ ! -e game.ini ] && cat $SHAREDIR/game.ini > game.ini
|
|
|
|
if [ "$( basename "$0" )" = "$PRGNAM-swing" ]; then
|
|
exec java -cp Domination.jar net.yura.domination.ui.swinggui.SwingGUIFrame "$@"
|
|
else
|
|
exec java -jar Domination.jar "$@"
|
|
fi
|