#!/bin/sh # The executable needs to run from its data directory, so we mirror it to # ~/.vavoom (with symlinks) and run it from there. CMD="vavoom" WRAPDIR=~/.vavoom make_symlinks() { cd %%DATADIR%%/basev || exit 1 find * -type d -exec mkdir -p ${WRAPDIR}/basev/{} \; find * -type f -exec ln -sf %%DATADIR%%/basev/{} ${WRAPDIR}/basev/{} \; } if [ "$1" = "-s" ] then CMD="vavoom-dedicated" shift elif [ "$1" = "-f" -a -d ${WRAPDIR} ] then echo "Fixing symlinks in ${WRAPDIR} directory." 1>&2 find -L ${WRAPDIR} -type l -delete make_symlinks exit 0 fi if [ -d ${WRAPDIR} ] then echo "Using existing ${WRAPDIR} directory." 1>&2 else echo "Creating ${WRAPDIR} directory." 1>&2 make_symlinks fi cd ${WRAPDIR} || exit 1 exec %%PREFIX%%/libexec/vavoom/${CMD} -iwaddir %%DMDIR%% "$@"