aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/mldonkey-gui/files/wrapper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/mldonkey-gui/files/wrapper.sh')
-rw-r--r--net-p2p/mldonkey-gui/files/wrapper.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/net-p2p/mldonkey-gui/files/wrapper.sh b/net-p2p/mldonkey-gui/files/wrapper.sh
new file mode 100644
index 000000000000..c25fd62bc133
--- /dev/null
+++ b/net-p2p/mldonkey-gui/files/wrapper.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+PREFIX="%%PREFIX%%/bin"
+PROGRAM="${0}"
+DIRNAME=${HOME}/.mldonkey
+
+if [ ! -d ${DIRNAME} ]
+then
+ mkdir -p ${DIRNAME}
+fi
+
+echo " ${*} " | grep " \-createdironly " ||
+{
+ cd ${DIRNAME} &&
+ echo Running under ${DIRNAME} &&
+ exec ${PREFIX}/${PROGRAM##*/}-real "${@}" ||
+ echo PROBLEM. Cannot create directory ${DIRNAME}, make sure you have the proper permissions to create it and try again
+}