freebsd-ports/net/edonkey-core/files/wrapper.sh
Mario Sergio Fujikawa Ferreira d7dc992dc7 o Separate donkey script wrapper and donkey-real binary: wrapper
stays at bin but binary goes to sbin (this does not break hier(7))
o Bump PORTREVISION since this change is needed by the upcoming
  edonkey-gui-gtk port update
2002-05-06 16:56:31 +00:00

23 lines
501 B
Bash

#!/bin/sh
PREFIX="%%PREFIX%%"
PROGRAM="${0}"
DIRNAME=${HOME}/.edonkey2000-core
if [ ! -d ${DIRNAME} ]
then
mkdir -p ${DIRNAME}
fi
if [ ! -h ${DIRNAME}/${PROGRAM##*/} ]
then
ln -sf ${PREFIX}/sbin/${PROGRAM##*/}-real ${DIRNAME}/${PROGRAM##*/}
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
}