diff options
author | Raúl Porcel <armin76@gentoo.org> | 2010-10-02 15:36:03 +0000 |
---|---|---|
committer | Raúl Porcel <armin76@gentoo.org> | 2010-10-02 15:36:03 +0000 |
commit | ab12596d8ed2ef0dbed02e3f26210ef63fb7745f (patch) | |
tree | 7a61514376de3c4c9a7f1a8f7d5e7f3232ac62e9 /net-p2p | |
parent | Stable on alpha, bug #313331 (diff) | |
download | gentoo-2-ab12596d8ed2ef0dbed02e3f26210ef63fb7745f.tar.gz gentoo-2-ab12596d8ed2ef0dbed02e3f26210ef63fb7745f.tar.bz2 gentoo-2-ab12596d8ed2ef0dbed02e3f26210ef63fb7745f.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>
(Portage version: 2.1.8.3/cvs/Linux ia64)
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/deluge/ChangeLog | 7 | ||||
-rw-r--r-- | net-p2p/deluge/files/deluged.init | 22 |
2 files changed, 17 insertions, 12 deletions
diff --git a/net-p2p/deluge/ChangeLog b/net-p2p/deluge/ChangeLog index 2270b2c39df9..473e5a01ce61 100644 --- a/net-p2p/deluge/ChangeLog +++ b/net-p2p/deluge/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-p2p/deluge # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/ChangeLog,v 1.150 2010/09/29 13:02:00 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/deluge/ChangeLog,v 1.151 2010/10/02 15:36:03 armin76 Exp $ + + 02 Oct 2010; Raúl Porcel <armin76@gentoo.org> files/deluged.init: + 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> *deluge-1.3.0 (29 Sep 2010) 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 |