diff options
| author | Ben Kohler <bkohler@gentoo.org> | 2018-10-09 08:45:50 -0500 |
|---|---|---|
| committer | Ben Kohler <bkohler@gentoo.org> | 2018-10-09 08:45:50 -0500 |
| commit | 8c537ceacee34afc593a7dff3224db4131193f5a (patch) | |
| tree | b63c1c2ba8490a7ac721d9e1b34f95dab42f9399 /net-proxy/tinyproxy/files/tinyproxy-1.10.0.initd | |
| parent | eae5ea96617080b6bc665a8f9816f8f2c2fd2e7d (diff) | |
| download | gentoo-8c537ceacee34afc593a7dff3224db4131193f5a.tar.gz gentoo-8c537ceacee34afc593a7dff3224db4131193f5a.tar.bz2 gentoo-8c537ceacee34afc593a7dff3224db4131193f5a.zip | |
net-proxy/tinyproxy: revbump for changed paths in service files
Signed-off-by: Ben Kohler <bkohler@gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11
Diffstat (limited to 'net-proxy/tinyproxy/files/tinyproxy-1.10.0.initd')
| -rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.10.0.initd | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.10.0.initd b/net-proxy/tinyproxy/files/tinyproxy-1.10.0.initd new file mode 100644 index 000000000000..48688a2c19c5 --- /dev/null +++ b/net-proxy/tinyproxy/files/tinyproxy-1.10.0.initd @@ -0,0 +1,40 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +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}/${SVCNAME}.conf"} + +command=/usr/bin/tinyproxy +command_args="-c ${CONFFILE}" +pidfile=$(get_config PidFile /run/tinyproxy/${SVCNAME}.pid) + +depend() { + config "$CONFFILE" + + use dns + + [ "$(get_config Syslog Off)" = "On" ] && \ + use logger +} + +start_pre() { + piddir=$(dirname ${pidfile}) + + if [ "${piddir}" = "/run" ]; then + eerror "Please change your PidFile settings to be within the" + eerror "/run/tinyproxy directory" + eend 1 + else + checkpath -d -o $(get_config User tinyproxy):$(get_config Group tinyproxy) ${piddir} + fi +} |
