From: Nicolas Thill Date: Mon, 14 Nov 2011 23:30:55 +0000 (+0000) Subject: packages/polipo: use new service functions X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=d8e3ee90ade09402777949ba06bd7974988a315a packages/polipo: use new service functions SVN-Revision: 29139 --- diff --git a/net/polipo/Makefile b/net/polipo/Makefile index bbd54eb7af..8099e6588b 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 5b5d54ce4d..ec1d75654b 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() {