summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Porcel <armin76@gentoo.org>2010-10-02 15:36:03 +0000
committerRaúl Porcel <armin76@gentoo.org>2010-10-02 15:36:03 +0000
commitd36f28ede1d95d7bf20def4c1cfe4d0365d4cdc8 (patch)
tree0d5a8cfd50a68091406a93c096c7242b0a74d3a2 /net-p2p/deluge/files
parentStable on alpha, bug #313331 (diff)
downloadhistorical-d36f28ede1d95d7bf20def4c1cfe4d0365d4cdc8.tar.gz
historical-d36f28ede1d95d7bf20def4c1cfe4d0365d4cdc8.tar.bz2
historical-d36f28ede1d95d7bf20def4c1cfe4d0365d4cdc8.zip
Update init script, bug #339352, bug #288599, thanks to Juanlu Pérez <juanluperez at gmail dot com>, Paolo Pedroni <paolo dot pedroni at iol dot it> and Michał Górny <mgorny at gentoo dot org>
Package-Manager: portage-2.1.8.3/cvs/Linux ia64
Diffstat (limited to 'net-p2p/deluge/files')
-rw-r--r--net-p2p/deluge/files/deluged.init22
1 files changed, 11 insertions, 11 deletions
diff --git a/net-p2p/deluge/files/deluged.init b/net-p2p/deluge/files/deluged.init
index f9b2a306a405..b409a8901f55 100644
--- a/net-p2p/deluge/files/deluged.init
+++ b/net-p2p/deluge/files/deluged.init
@@ -1,28 +1,28 @@
#!/sbin/runscript
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/files/deluged.init,v 1.5 2009/02/17 15:32:17 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/files/deluged.init,v 1.6 2010/10/02 15:36:03 armin76 Exp $
depend() {
need net
}
checkconfig() {
- if [[ "${DELUGED_USER}" == "" ]] ; then
+ if [ "${DELUGED_USER}" = "" ] ; then
eerror "Please edit /etc/conf.d/deluged"
eerror "You have to specify a user to run deluged as, as we will not run it as root!"
eerror "Modify DELUGED_USER to your needs (you can also add a group, after a colon)"
return 1
fi
- if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 1 ) -sq` ; then
+ if ! getent passwd "${DELUGED_USER%:*}" >/dev/null ; then
eerror "Please edit /etc/conf.d/deluged"
eerror "Your user has to exist!"
return 1
fi
- if ! `echo "${DELUGED_USER}" | grep ':' -sq` ; then
+ if [ "${DELUGED_USER%:*}" = "${DELUGED_USER}" ] ; then
return 0
else
- if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${DELUGED_USER}" | cut -d ':' -f 2 ) -sq` ; then
+ if ! getent group "${DELUGED_USER#*:}" >/dev/null ; then
eerror "Please edit /etc/conf.d/deluged"
eerror "Your group has to exist too!"
return 1
@@ -33,10 +33,10 @@ checkconfig() {
start() {
checkconfig || return $?
- if [[ "${DELUGED_HOME}" == "" ]] ; then
- DELUGED_USER_HOME=`getent passwd | grep ^$( echo "${DELUGED_USER}" | cut -d ':' -f 1 ): | cut -d ':' -f 6`
+ if [ "${DELUGED_HOME}" = "" ] ; then
+ DELUGED_USER_HOME=$(getent passwd "${DELUGED_USER%:*}" | cut -d ':' -f 6)
else
- DELUGED_USER_HOME="${DELUGED_HOME}"
+ DELUGED_USER_HOME=${DELUGED_HOME}
fi
ebegin "Starting Deluged"
start-stop-daemon --start --user "${DELUGED_USER}" \
@@ -45,7 +45,7 @@ start() {
eend $?
- if [[ "${DELUGEUI_START}" == "true" ]] ; then
+ if [ "${DELUGEUI_START}" = "true" ] ; then
ebegin "Starting Deluge"
start-stop-daemon --start --background --pidfile \
/var/run/deluge.pid --make-pidfile \
@@ -62,7 +62,7 @@ stop() {
eend $?
- if [[ "${DELUGEUI_START}" == "true" ]] ; then
+ if [ "${DELUGEUI_START}" = "true" ] ; then
ebegin "Stopping Deluge"
start-stop-daemon --stop --user "${DELUGED_USER}" \
--name deluge --pidfile /var/run/deluge.pid