updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / psx / psx.sh
blobc791cff1afc1ae82f198faaf654c977346e29737
1 #!/bin/sh
3 psx_libdir="/usr/lib/pSX"
4 psx_sharedir="/usr/share/pSX"
5 psx_localdir="$HOME/.pSX"
7 # create local directories if not present
8 mkdir -p "${psx_localdir}"/{bios,cdimages}
10 # copy and edit configuration if not present
11 if ! [ -f "${psx_localdir}/psx.ini" ]; then
12 cp ${psx_sharedir}/psx.ini "${psx_localdir}"
13 sed -e "s|psx_localdir|${psx_localdir}|" \
14 -i "${psx_localdir}/psx.ini"
17 # create links for every bios and every cdimage in psx_sharedir
18 if [ $(ls -1A ${psx_sharedir}/bios | wc -l) -gt 0 ]; then
19 for i in ${psx_sharedir}/bios/*; do
20 ln -sf "$i" "${psx_localdir}/bios/$(basename "$i")"
21 done
24 if [ $(ls -1A ${psx_sharedir}/cdimages | wc -l) -gt 0 ]; then
25 for i in ${psx_sharedir}/cdimages/*; do
26 ln -sf "$i" "${psx_localdir}/cdimages/$(basename "$i")"
27 done
30 # here we go!
31 ${psx_libdir}/pSX "$@"