summaryrefslogtreecommitdiff
path: root/audio/agsatellite/files/wrapper.sh
blob: fb7fdbd6f49251dc809eafbb0378ef5c0b206e70 (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
24
25
26
#!/bin/sh

PREFIX="%%PREFIX%%"
PROGRAM="${0}"

if [ ${#} -gt 1 ]
then
	shift
fi

if [ ! -d ${HOME}/.agsatellite ]
then
	mkdir -p ${HOME}/.agsatellite
fi

if [ ! -h ${HOME}/.agsatellite/${PROGRAM##*/} ]
then
	ln -sf ${PREFIX}/bin/${PROGRAM##*/}-real ${HOME}/.agsatellite/${PROGRAM##*/}
fi

echo " ${*} " | grep " \-createdironly " ||
	cd ${HOME}/.agsatellite &&
	echo Running Audio Galaxy Satellite under ${HOME}/.agsatellite &&
	echo Create both account.txt and shares.txt files under ${HOME}/.agsatellite &&
	exec ./${PROGRAM##*/} ${*} ||
	echo PROBLEM. Cannot create directory ${HOME}/.agsatellite, make sure you have the proper permissions to create itnd try again