#!/bin/bash PN=VisualBoyAdvance if ! [ -d ~/.${PN}/save ]; then mkdir -p ~/.${PN}/save cd ~/.${PN} ln -s `which ${PN}` . cp /usr/games/share/${PN}/${PN}.cfg . mv ${PN}.cfg ${PN}.cfg.old sed -e "s:#saveDir.*:saveDir ${HOME}/.${PN}/save:" \ -e "s:#captureDir.*:captureDir ${HOME}/.${PN}:" \ -e "s:#batteryDir.*:batteryDir ${HOME}/.${PN}/save:" \ ${PN}.cfg.old > ${PN}.cfg rm -f ${PN}.cfg.old fi cd ~/.${PN} ./${PN} $@