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")"
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")"
31 ${psx_libdir}/pSX
"$@"