Merge pull request #3374 from chris5560/master

privoxy: fix handling config section "system"
This commit is contained in:
Hannu Nyman 2016-10-23 23:55:34 +03:00 committed by GitHub
commit b2c66cf412
2 changed files with 37 additions and 31 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=privoxy
PKG_VERSION:=3.0.26
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
PKG_SOURCE_URL:=@SF/ijbswa
@ -151,7 +151,7 @@ define Package/$(PKG_NAME)/install
$(1)/etc/config
$(INSTALL_DATA) ./files/privoxy.upgrade $(1)/lib/upgrade/keep.d/privoxy
$(INSTALL_BIN) ./files/privoxy.init $(1)/etc/init.d/privoxy
$(INSTALL_BIN) ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/80-privoxy
$(INSTALL_BIN) ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/95-privoxy
$(INSTALL_CONF) ./files/privoxy.config $(1)/etc/config/privoxy
endef

View File

@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
START=80
STOP=20
START=95
STOP=10
PIDFILE=/var/run/privoxy.pid
CFGFILE=/var/etc/privoxy.conf
@ -9,6 +9,10 @@ CFGTEMP=/var/etc/privoxy.conf.tmp
_uci2conf() {
# redefined callback for options when calling config_load
config_cb() {
if [ ."$2" != ."privoxy" ]; then
option_cb() { return 0; }
else
option_cb()
{
# $1 name of variable
@ -36,6 +40,8 @@ _uci2conf() {
;;
esac
}
fi
}
# temporary config file
# privoxy need read access
@ -92,7 +98,7 @@ _uci2conf() {
echo -e "temporary-directory\t$_TMP_DIR" >> $CFGTEMP
fi
config_load privoxy # calling above option_cb() and write the rest into $CFGTEMP
config_load "privoxy" # calling above option_cb() and write the rest into $CFGTEMP
# move temp to final privoxy readable configuration
mv -f $CFGTEMP $CFGFILE