diff options
author | Alin Năstac <mrness@gentoo.org> | 2008-02-16 07:11:25 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2008-02-16 07:11:25 +0000 |
commit | 474c0860f9a95828d60ccee1a410dad12d4d9f9a (patch) | |
tree | 21bdd7101d807247c79d57d60457069856dc13e6 /net-proxy/tinyproxy/files | |
parent | Stable for HPPA (bug #210197). (diff) | |
download | historical-474c0860f9a95828d60ccee1a410dad12d4d9f9a.tar.gz historical-474c0860f9a95828d60ccee1a410dad12d4d9f9a.tar.bz2 historical-474c0860f9a95828d60ccee1a410dad12d4d9f9a.zip |
Improve init script (#209115).
Package-Manager: portage-2.1.3.19
RepoMan-Options: --force
Diffstat (limited to 'net-proxy/tinyproxy/files')
-rw-r--r-- | net-proxy/tinyproxy/files/digest-tinyproxy-1.6.3-r1 | 3 | ||||
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy.initd | 45 | ||||
-rwxr-xr-x | net-proxy/tinyproxy/files/tinyproxy.rc | 26 |
3 files changed, 48 insertions, 26 deletions
diff --git a/net-proxy/tinyproxy/files/digest-tinyproxy-1.6.3-r1 b/net-proxy/tinyproxy/files/digest-tinyproxy-1.6.3-r1 new file mode 100644 index 000000000000..3bf72ce9148c --- /dev/null +++ b/net-proxy/tinyproxy/files/digest-tinyproxy-1.6.3-r1 @@ -0,0 +1,3 @@ +MD5 bd14d029b12621bcfd7ee71b2f4893da tinyproxy-1.6.3.tar.gz 467348 +RMD160 a5503d03bdfe00fd232c643b518bd6c3e034dc33 tinyproxy-1.6.3.tar.gz 467348 +SHA256 cf4f2005fcd69f10087c598398c1a156d1827b9fb11c769ab6587b7b1ea4a2dc tinyproxy-1.6.3.tar.gz 467348 diff --git a/net-proxy/tinyproxy/files/tinyproxy.initd b/net-proxy/tinyproxy/files/tinyproxy.initd new file mode 100644 index 000000000000..bee5d041fbdc --- /dev/null +++ b/net-proxy/tinyproxy/files/tinyproxy.initd @@ -0,0 +1,45 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/files/tinyproxy.initd,v 1.1 2008/02/16 07:11:25 mrness Exp $ + +CONFFILE="/etc/tinyproxy/${SVCNAME}.conf" + +depend() { + use logger dns + need net +} + +checkconfig() { + if [ ! -f "${CONFFILE}" ]; then + eerror "Configuration file ${CONFFILE} not found!" + return 1 + fi + + PIDFILE=$(sed -n -e 's/^[[:space:]]*PidFile[[:space:]]\+"\(.*\)"[[:space:]]*$/\1/p' "${CONFFILE}") + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting tinyproxy" + if [ -n "${PIDFILE}" ]; then + start-stop-daemon --start --pidfile "${PIDFILE}" --startas /usr/sbin/tinyproxy -- -c "${CONFFILE}" + else + start-stop-daemon --start --exec /usr/sbin/tinyproxy -- -c "${CONFFILE}" + fi + eend $? +} + +stop() { + checkconfig || return 1 + + ebegin "Stopping tinyproxy" + if [ -n "${PIDFILE}" ]; then + start-stop-daemon --stop --pidfile "${PIDFILE}" + else + start-stop-daemon --stop --exec /usr/sbin/tinyproxy + fi + eend $? +} diff --git a/net-proxy/tinyproxy/files/tinyproxy.rc b/net-proxy/tinyproxy/files/tinyproxy.rc deleted file mode 100755 index 83aa85c27645..000000000000 --- a/net-proxy/tinyproxy/files/tinyproxy.rc +++ /dev/null @@ -1,26 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/files/tinyproxy.rc,v 1.1 2005/04/22 19:15:12 mrness Exp $ - -depend() { - use logger dns - need net -} - -start() { - ebegin "Starting tinyproxy" - /usr/sbin/tinyproxy - eend $? -} - -stop() { - local pid=0 - if [ -f /var/run/tinyproxy.pid ] ; then - pid=$(</var/run/tinyproxy.pid) - rm /var/run/tinyproxy.pid - fi - ebegin "Stopping tinyproxy" - [ ${pid} -ne 0 ] && kill ${pid} - eend $? -} |