Changeset 28929


Ignore:
Timestamp:
2011-11-10T00:49:28+01:00 (4 years ago)
Author:
nico
Message:

packages/wide-dhcpv6: use new service functions

Location:
packages/ipv6/wide-dhcpv6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • packages/ipv6/wide-dhcpv6/Makefile

    r28079 r28929  
     1# 
     2# Copyright (C) 2010-2011 OpenWrt.org 
     3# 
     4# This is free software, licensed under the GNU General Public License v2. 
     5# See /LICENSE for more information. 
     6# 
    17 
    28include $(TOPDIR)/rules.mk 
  • packages/ipv6/wide-dhcpv6/files/dhcp6s.init

    r20212 r28929  
    11#!/bin/sh /etc/rc.common  
     2# Copyright (C) 2010-2011 OpenWrt.org 
     3 
     4SERVICE_USE_PID=1 
    25 
    36get_ifname() { 
     
    1114 
    1215start() { 
    13  
    1416        [ ! -e /etc/dhcp6sctlkey ] && `dd if=/dev/urandom count=1 2> /dev/null | md5sum | cut -d" " -f1 > /etc/dhcp6sctlkey` 
    1517 
     
    1921 
    2022        config_load "dhcp6s" 
    21          
     23 
    2224        local enabled 
    2325        config_get_bool enabled basic enabled 0 
    2426        [ $enabled -eq 0 ] && return 0 
    25          
     27 
    2628        logger starting dhcp6s 
    27          
     29 
    2830        local server_interface  
    2931        config_get server_interface basic interface 
    3032        local server_ifname=$(get_ifname "$server_interface") 
    31          
     33 
    3234        local config_file 
    3335        config_get config_file basic config_file 
    3436 
    3537        [ ! -e $config_file ] && return 1 
    36          
    37         /usr/sbin/dhcp6s -c $config_file $server_ifname 
    38          
    39         return 0 
    40          
     38 
     39        service_start /usr/sbin/dhcp6s -c $config_file $server_ifname 
    4140} 
    4241 
    4342stop() { 
    44  
    4543        logger stopping dhcp6s 
    46         kill -TERM `cat /var/run/dhcp6s.pid` 
    47         return 0 
    48          
     44        service_stop /usr/sbin/dhcp6s 
    4945} 
    5046 
Note: See TracChangeset for help on using the changeset viewer.