aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/linux-edonkey-core/files/wrapper.sh
blob: 46fd18de71cddbbe6b970d0fba512b8f72c0b5d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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}/bin/${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
}