diff options
Diffstat (limited to 'net/edonkey-gui-gtk/files/wrapper.sh')
-rw-r--r-- | net/edonkey-gui-gtk/files/wrapper.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/edonkey-gui-gtk/files/wrapper.sh b/net/edonkey-gui-gtk/files/wrapper.sh new file mode 100644 index 000000000000..f6ca8cb91daf --- /dev/null +++ b/net/edonkey-gui-gtk/files/wrapper.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +PREFIX="%%PREFIX%%" +PROGRAM="${0}" +DIRNAME=${HOME}/.edonkey2000-gui-gtk +DATADIR="%%DATADIR%%" +DATAFILES="%%DATAFILES%%" + +if [ ${#} -gt 1 ] +then + shift +fi + +if [ ! -d ${DIRNAME} ] +then + mkdir -p ${DIRNAME} +fi + +if [ ! -h ${DIRNAME}/${PROGRAM##*/} ] +then + ln -sf ${PREFIX}/bin/${PROGRAM##*/}-real ${DIRNAME}/${PROGRAM##*/} + for file in ${DATAFILES} + do + ln -sf "${DATADIR}/${file}" "${DIRNAME}/${file}" + done +fi + +echo " ${*} " | grep " \-createdironly " || +{ + cd ${DIRNAME} && + echo Running under ${DIRNAME} && + exec ./${PROGRAM##*/} ${*} || + echo PROBLEM. Cannot create directory ${DIRNAME}, make sure you have the proper permissions to create it and try again +} |