#
-# 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.
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/
#!/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() {