From 68a4679ec26cf8fc1124ac5824eef811cbf1e358 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 5 Feb 2012 15:54:11 +0000 Subject: [PATCH] polipo: merge r29139 SVN-Revision: 30238 --- net/polipo/Makefile | 4 ++-- net/polipo/files/polipo.init | 36 ++++++++++++------------------------ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/net/polipo/Makefile b/net/polipo/Makefile index bbd54eb7a..8099e6588 100644 --- a/net/polipo/Makefile +++ b/net/polipo/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=polipo PKG_VERSION:=1.0.4.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://freehaven.net/~chrisd/polipo/ diff --git a/net/polipo/files/polipo.init b/net/polipo/files/polipo.init index 5b5d54ce4..ec1d75654 100644 --- a/net/polipo/files/polipo.init +++ b/net/polipo/files/polipo.init @@ -1,47 +1,35 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2008 OpenWrt.org +# Copyright (C) 2008-2011 OpenWrt.org + START=99 -DAEMON=/usr/sbin/polipo CFGFILE=/var/etc/polipo.conf start() { - config_load polipo + config_load 'polipo' - config_get_bool enabled "general" enabled - [ "$enabled" -ne "1" ] && { - echo 'Polipo is disabled.' - return 0 - } + config_get_bool enabled "general" 'enabled' '0' + [ $enabled -gt 0 ] || return 1 - mkdir -p /var/etc/ + mkdir -m 0755 -p /var/etc/ echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE echo '### DO NOT EDIT' >> $CFGFILE echo '### SEE /etc/config/polipo INSTEAD' >> $CFGFILE echo '' >> $CFGFILE - config_foreach polipo_config polipo - - # handle values that are disabled when not defiend or empty + config_foreach polipo_config 'polipo' + + # handle values that are disabled when not defined or empty echo "### VALUES THAT ARE DISABLED WHEN EMPTY" >> $CFGFILE polipo_atom "cache" "diskCacheRoot" '"' "1" >> $CFGFILE polipo_atom "general" "logFile" '"' "1" >> $CFGFILE polipo_atom "general" "localDocumentRoot" '"' "1" >> $CFGFILE - - echo 'Polipo is starting...' - start-stop-daemon -S -q -x "$DAEMON" -- -c "$CFGFILE" -} -stop() { - echo 'Polipo is stopping...' - start-stop-daemon -K -q -x "$DAEMON" - rm -f $CFGFILE + service_start /usr/sbin/polipo -c "$CFGFILE" } -restart() { - stop - sleep 2 - start +stop() { + service_stop /usr/sbin/polipo -c "$CFGFILE" } polipo_config() { -- 2.30.2