diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2013-05-29 17:48:41 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2013-05-29 17:48:41 +0000 |
commit | 54d342f402b6d0d36afab837a148c0835c4be00c (patch) | |
tree | b670628a4f50fb797c9ef651ac92260f0955442d /net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd | |
parent | Additional permissions fix - 471654 (diff) | |
download | historical-54d342f402b6d0d36afab837a148c0835c4be00c.tar.gz historical-54d342f402b6d0d36afab837a148c0835c4be00c.tar.bz2 historical-54d342f402b6d0d36afab837a148c0835c4be00c.zip |
Cleanup ebuild, use REQUIRED_USE, always install docs, improve init script so that now it actually works.
Package-Manager: portage-2.2.0_alpha176/cvs/Linux x86_64
Manifest-Sign-Key: 0x1CD13C8AD4301342
Diffstat (limited to 'net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd')
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd b/net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd new file mode 100644 index 000000000000..eed8f54d3d2e --- /dev/null +++ b/net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd @@ -0,0 +1,41 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd,v 1.1 2013/05/29 17:48:35 flameeyes Exp $ + +get_config() { + res=$(awk '$1 == "'$1'" { s=$2 } END { print s }' "$CONFFILE") + + if [ "x$res" = "x" ]; then + echo "$2" + else + eval echo "$res" + fi +} + +: ${CONFFILE:="/etc/${SVCNAME}.conf"} + +command=/usr/sbin/tinyproxy +command_args="-c ${CONFFILE}" +pidfile=$(get_config PidFile /var/run/tinyproxy/${SVCNAME}.pid) + +depend() { + config "$CONFFILE" + + use dns + + [ "$(get_config Syslog Off)" = "On" ] && \ + use logger +} + +start_pre() { + piddir=$(dirname ${pidfile}) + + if [ "${piddir}" = "/var/run" ]; then + eerror "Please change your PidFile settings to be within the" + eerror "/var/run/tinyproxy directory" + eend 1 + else + checkpath -d -o $(get_config User tinyproxy):$(get_config Group tinyproxy) ${piddir} + fi +} |