aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net-p2p/deluge-cli/Makefile2
-rw-r--r--net-p2p/deluge-cli/files/deluge_web.in16
2 files changed, 11 insertions, 7 deletions
diff --git a/net-p2p/deluge-cli/Makefile b/net-p2p/deluge-cli/Makefile
index 52da67fd6f85..d1b21f2654d8 100644
--- a/net-p2p/deluge-cli/Makefile
+++ b/net-p2p/deluge-cli/Makefile
@@ -3,7 +3,7 @@
PORTNAME= deluge
DISTVERSIONPREFIX= ${PORTNAME}-
DISTVERSION= 1.3.15
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= net-p2p python
PKGNAMESUFFIX= -cli
diff --git a/net-p2p/deluge-cli/files/deluge_web.in b/net-p2p/deluge-cli/files/deluge_web.in
index 63962d773ac3..0b05665bee84 100644
--- a/net-p2p/deluge-cli/files/deluge_web.in
+++ b/net-p2p/deluge-cli/files/deluge_web.in
@@ -39,11 +39,16 @@ command_interpreter=%%PYTHON_CMD%%
start_precmd=${name}_prestart
stop_postcmd=${name}_poststop
+
deluge_web_prestart()
{
if [ "$deluge_web_user" = 'asjklasdfjklasdf' ]; then
err 1 "You must set deluge_web_user to a real, unprivileged user"
fi
+ deluge_web_home=$(pw user show ${deluge_web_user} | cut -d : -f 9)
+ if [ -z ${deluge_web_home} ]; then
+ err 1 "deluge_web_user does not have a valid home directory."
+ fi
if [ ! -d "/var/run/${name}" ]; then
if [ -e "/var/run/${name}" ]; then
@@ -52,14 +57,13 @@ deluge_web_prestart()
mkdir -p /var/run/${name}
fi
- if [ ! -d "/home/${deluge_web_user}/.python-eggs" ]; then
- mkdir -p /home/${deluge_web_user}/.python-eggs
- fi
+ if [ ! -d "${deluge_web_home}/.python-eggs" ]; then
+ mkdir ${deluge_web_home}/.python-eggs
+ chown -R $deluge_web_user ${deluge_web_home}/.python-eggs
chmod 0755 /var/run/${name}
chown -R $deluge_web_user /var/run/${name}
- chown -R $deluge_web_user /home/${deluge_web_user}/.python-eggs
- export PYTHON_EGG_CACHE="/home/${deluge_web_user}/.python-eggs"
+ export PYTHON_EGG_CACHE="${deluge_web_home}/.python-eggs"
}
deluge_web_poststop()
@@ -72,7 +76,7 @@ load_rc_config $name
: ${deluge_web_enable:="NO"}
: ${deluge_web_user:="asjklasdfjklasdf"}
-: ${deluge_web_confdir:="/home/${deluge_web_user}/.config/deluge"}
+: ${deluge_web_confdir:="${deluge_web_home}/.config/deluge"}
: ${deluge_web_loglevel:="error"}
: ${deluge_web_logfile:="/var/tmp/${name}.log"}