#!/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 # ~/.fheroes2, and create symlinks to the data files. if [ -d ~/.fheroes2 ] then echo "Using existing ~/.fheroes2 directory." else echo "Creating ~/.fheroes2 directory." cd %%DATADIR%% || exit 1 find . -type d \! \( -name config \) -exec mkdir -p ~/.fheroes2/{} \; find * -type f -exec ln -s %%DATADIR%%/{} ~/.fheroes2/{} \; 2>/dev/null mkdir ~/.fheroes2/config ~/.fheroes2/saves cp -f %%DATADIR%%/config/keybindings.txt ~/.fheroes2/config/ cp -f %%DATADIR%%/config/settings.txt ~/.fheroes2/config/ chmod 640 ~/.fheroes2/config/keybindings.txt ~/.fheroes2/config/settings.txt fi cd ~/.fheroes2 || exit 1 echo "Loading..." exec %%DATADIR%%/fheroes2 "$@"