Changeset 29139


Ignore:
Timestamp:
2011-11-15T00:30:55+01:00 (5 years ago)
Author:
nico
Message:

packages/polipo: use new service functions

Location:
packages/net/polipo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/polipo/Makefile

    r26061 r29139  
    11#  
    2 # Copyright (C) 2007 OpenWrt.org 
     2# Copyright (C) 2007-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=polipo 
    1111PKG_VERSION:=1.0.4.1 
    12 PKG_RELEASE:=2 
     12PKG_RELEASE:=3 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
  • packages/net/polipo/files/polipo.init

    r24260 r29139  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2008 OpenWrt.org 
     2# Copyright (C) 2008-2011 OpenWrt.org 
     3 
    34START=99 
    45 
    5 DAEMON=/usr/sbin/polipo 
    66CFGFILE=/var/etc/polipo.conf 
    77 
    88start() { 
    9         config_load polipo 
     9        config_load 'polipo' 
    1010 
    11         config_get_bool enabled "general" enabled 
    12         [ "$enabled" -ne "1" ] && { 
    13                 echo 'Polipo is disabled.' 
    14                 return 0 
    15         } 
     11        config_get_bool enabled "general" 'enabled' '0' 
     12        [ $enabled -gt 0 ] || return 1 
    1613 
    17         mkdir -p /var/etc/       
     14        mkdir -m 0755 -p /var/etc/ 
    1815        echo '### AUTOGENERATED CONFIGURATION' > $CFGFILE 
    1916        echo '### DO NOT EDIT' >> $CFGFILE 
     
    2118        echo '' >> $CFGFILE 
    2219 
    23         config_foreach polipo_config polipo 
    24          
    25         # handle values that are disabled when not defiend or empty 
     20        config_foreach polipo_config 'polipo' 
     21 
     22        # handle values that are disabled when not defined or empty 
    2623        echo "### VALUES THAT ARE DISABLED WHEN EMPTY" >> $CFGFILE 
    2724        polipo_atom "cache" "diskCacheRoot" '"' "1" >> $CFGFILE 
    2825        polipo_atom "general" "logFile" '"' "1" >> $CFGFILE 
    2926        polipo_atom "general" "localDocumentRoot" '"' "1" >> $CFGFILE 
    30          
    31         echo 'Polipo is starting...' 
    32         start-stop-daemon -S -q -x "$DAEMON" -- -c "$CFGFILE" 
     27 
     28        service_start /usr/sbin/polipo -c "$CFGFILE" 
    3329} 
    3430 
    3531stop() { 
    36         echo 'Polipo is stopping...' 
    37         start-stop-daemon -K -q -x "$DAEMON" 
    38         rm -f $CFGFILE 
    39 } 
    40  
    41 restart() { 
    42         stop 
    43         sleep 2 
    44         start 
     32        service_stop /usr/sbin/polipo -c "$CFGFILE" 
    4533} 
    4634 
Note: See TracChangeset for help on using the changeset viewer.