Changeset 27141 for packages


Ignore:
Timestamp:
2011-06-09T02:34:46+02:00 (5 years ago)
Author:
jow
Message:

[packages] stun: fix init script (#9528)

Location:
packages/net/stun
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/net/stun/Makefile

    r15480 r27141  
    11#  
    2 # Copyright (C) 2008-2009 OpenWrt.org 
     2# Copyright (C) 2008-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    1010PKG_NAME:=stund 
    1111PKG_VERSION:=0.96 
    12 PKG_RELEASE:=2 
     12PKG_RELEASE:=3 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION)_Aug13.tgz 
     
    6969        $(INSTALL_BIN) $(PKG_BUILD_DIR)/server $(1)/usr/sbin/stund 
    7070        $(INSTALL_DIR) $(1)/etc/init.d 
    71         $(INSTALL_BIN) ./files/stund.init $(1)/etc/init.d/ 
     71        $(INSTALL_BIN) ./files/stund.init $(1)/etc/init.d/stund 
    7272        $(INSTALL_DIR) $(1)/etc/config 
    7373        $(INSTALL_DATA) ./files/stund.config $(1)/etc/config/stund 
  • packages/net/stun/files/stund.init

    r14206 r27141  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2009 OpenWrt.org 
     2# Copyright (C) 2009-2011 OpenWrt.org 
     3 
    34START=70 
    45 
    56start() { 
    6         config_load "6stund" 
     7        local pri_ip sec_ip pri_port sec_port 
     8        parse_opts() { 
     9                local cfg="$1" 
     10                config_get pri_ip   "$cfg" primaryip 
     11                config_get sec_ip   "$cfg" secondaryip 
     12                config_get pri_port "$cfg" primaryport 
     13                config_get sec_port "$cfg" secondaryport 
     14        } 
    715 
    8         config_get PRIMIP primaryip 
    9         config_get SECIP secondaryip 
    10         config_get PRIMPORT primaryport 
    11         config_get SECPORT secondaryport 
     16        config_load "stund" 
     17        config_foreach parse_opts 
    1218 
    13         /usr/sbin/stund -b -h $PRIMIP -a $SECIP -p $PRIMPORT -o $SECPORT 
     19        start-stop-daemon -S -p /var/run/stund.pid -m -b \ 
     20                -x /usr/sbin/stund -- \ 
     21                ${pri_ip:+-h $pri_ip} ${sec_ip:+-a $sec_ip} \ 
     22                ${pri_port:+-p $pri_port} ${sec_port:+-o $sec_port} 
    1423} 
    1524 
    1625stop() { 
    17         killall -9 stund 
     26        service_kill stund /var/run/stund.pid 
     27        rm -f /var/run/stund.pid 
    1828} 
Note: See TracChangeset for help on using the changeset viewer.