summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd')
-rw-r--r--net-proxy/tinyproxy/files/tinyproxy-1.8.3.initd41
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..0539996033eb
--- /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
+# $Id$
+
+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
+}