Changeset 14218


Ignore:
Timestamp:
2009-01-27T10:18:18+01:00 (9 years ago)
Author:
agb
Message:

[packages] net/vnstat: clean up initscript, reduce cron interval to 30 minutes. thanks puchu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/vnstat/Makefile

    r11976 r14218  
    11# 
    2 # Copyright (C) 2006 OpenWrt.org 
     2# Copyright (C) 2006-2009 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1111PKG_NAME:=vnstat 
    1212PKG_VERSION:=1.6 
    13 PKG_RELEASE:=1 
     13PKG_RELEASE:=2 
    1414 
    1515PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
     
    4545endef 
    4646 
    47 define Package/vnstat/install    
     47define Package/vnstat/install 
    4848        $(INSTALL_DIR) $(1)/usr/bin 
    4949        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/vnstat $(1)/usr/bin/ 
     
    5656define Package/vnstat/postinst 
    5757#!/bin/sh 
    58 BIN=$${IPKG_INSTROOT}/usr/bin/vnstat 
     58BIN_REL=/usr/bin/vnstat 
     59BIN=$${IPKG_INSTROOT}$${BIN_REL} 
    5960CRONTAB=$${IPKG_INSTROOT}/etc/crontabs/root 
    60 LIB_D=$${IPKG_INSTROOT}/var/lib/vnstat 
     61LIB_D_REL=/var/lib/vnstat 
     62LIB_D=$${IPKG_INSTROOT}$${LIB_D_REL} 
    6163mkdir -p $${IPKG_INSTROOT}/etc/crontabs/ 
    6264[ -d $$LIB_D ] || mkdir -p $$LIB_D 
     
    6567        [ -e $$LIB_D/$$IFACE_WAN ] || ( [ -x $$BIN ] && $$BIN -u -i $$IFACE_WAN ) 
    6668fi 
    67 grep -q "$$BIN -u" $$CRONTAB 2>/dev/null 
    68 [ $$? -ne 0 ] && echo "0-55/5 *   * * *   root    if [ -x $$BIN ] && [ \`ls $$LIB_D | wc -l\` -ge 1 ]; then $$BIN -u; fi" >> $$CRONTAB 
     69grep -q "$$BIN_REL -u" $$CRONTAB 2>/dev/null 
     70[ $$? -ne 0 ] && echo "*/30 * * * *   root    if [ -x $$BIN_REL ] && [ \`ls $$LIB_D_REL | wc -l\` -ge 1 ]; then $$BIN_REL -u; fi" >> $$CRONTAB 
    6971true 
    7072endef 
Note: See TracChangeset for help on using the changeset viewer.