From: nico Date: Wed, 16 Nov 2011 09:44:13 +0000 (+0000) Subject: packages/tinyproxy: use new service functions, change 'enable' option to 'enabled... X-Git-Url: http://git.archive.openwrt.org/?a=commitdiff_plain;h=e59863de27a7398cb0989c0e36ba8c3b35c4f86c;p=packages.git packages/tinyproxy: use new service functions, change 'enable' option to 'enabled' like most other services are using git-svn-id: svn://svn.openwrt.org/openwrt/packages@29173 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/net/tinyproxy/Makefile b/net/tinyproxy/Makefile index e6daa1e0b..a6b61ce0d 100644 --- a/net/tinyproxy/Makefile +++ b/net/tinyproxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tinyproxy PKG_VERSION:=1.8.2 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.banu.com/pub/tinyproxy/1.8/ diff --git a/net/tinyproxy/files/tinyproxy.config b/net/tinyproxy/files/tinyproxy.config index ffccc4072..dc4fb4f9c 100644 --- a/net/tinyproxy/files/tinyproxy.config +++ b/net/tinyproxy/files/tinyproxy.config @@ -3,7 +3,7 @@ config tinyproxy # # Enable the proxy # -option enable 0 +option enabled 0 # # Name of the user the tinyproxy daemon should switch to after the port diff --git a/net/tinyproxy/files/tinyproxy.init b/net/tinyproxy/files/tinyproxy.init index cff10c083..be7234a57 100644 --- a/net/tinyproxy/files/tinyproxy.init +++ b/net/tinyproxy/files/tinyproxy.init @@ -1,25 +1,28 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2008 OpenWrt.org +# Copyright (C) 2008-2011 OpenWrt.org + START=50 -DAEMON=/usr/sbin/tinyproxy CFGFILE=/var/etc/tinyproxy.conf +section_enabled() { + config_get_bool enabled "$1" 'enabled' 0 + [ $enabled -gt 0 ] +} + start() { - config_load tinyproxy - config_foreach start_proxy tinyproxy + config_load 'tinyproxy' + config_foreach start_proxy 'tinyproxy' } stop() { - start-stop-daemon -q -x "$DAEMON" -K - rm -f $CFGFILE + service_stop /usr/sbin/tinyproxy } start_proxy() { - config_get_bool enable "$1" enable - [ "$enable" -eq "1" ] || return 0 + section_enabled "$1" || return 1 - mkdir -p /var/etc + mkdir -m0755 -p /var/etc echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE echo '### DO NOT EDIT' >> $CFGFILE echo '### SEE /etc/config/tinyproxy INSTEAD' >> $CFGFILE @@ -69,7 +72,7 @@ start_proxy() { config_foreach write_upstream upstream - start-stop-daemon -q -x "$DAEMON" -S -- -c "$CFGFILE" + service_start /usr/sbin/tinyproxy -c "$CFGFILE" } write_upstream() {