#!/bin/sh # The executable needs to be run from its data directory, and needs to store # configuration in it. We therefore mirror the data directory hierarchy in # ~/.glest, and create symlinks to the data files. if [ -d ~/.glest ] then echo "Using existing ~/.glest directory." else echo "Creating ~/.glest directory." cd %%DATADIR%% || exit 1 find * -type d -exec mkdir -p ~/.glest/{} \; find * -type f -exec ln -s %%DATADIR%%/{} ~/.glest/{} \; 2>/dev/null mkdir -p ~/.glest/screens mkdir -p ~/.glest/shaders/standard touch ~/.glest/glest.log rm ~/.glest/glest.ini ~/.glest/configuration.xml ~/.glest/glest rm ~/.glest/servers.ini cp -f %%DATADIR%%/configuration.xml ~/.glest/ cp -f %%DATADIR%%/glest.ini ~/.glest/ cp -f %%DATADIR%%/servers.ini ~/.glest/ fi cd ~/.glest || exit 1 exec %%DATADIR%%/glest "$@"