Ticket #4930: radiusd.3.init

File radiusd.3.init, 428 bytes (added by jake1981 <oskari.rauta@…>, 9 years ago)

files/radiusd.init - autodetect lan ip address with help of ifconfig and sed

Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2006 OpenWrt.org
3START=50
4
5DEFAULT=/etc/default/radiusd
6LOG_D=/var/log
7RUN_D=/var/run
8PID_F=$RUN_D/radiusd.pid
9RADACCT_D=/var/db/radacct
10IPADDR=$(ifconfig br-lan | sed -n 's/.*dr:\(.*\)Bc.*/\1/p')
11
12start() {
13        [ -f $DEFAULT ] && . $DEFAULT
14        mkdir -p $LOG_D
15        mkdir -p $RUN_D
16        mkdir -p $RADACCT_D
17        radiusd -i $IPADDR -p 1812,1813 $OPTIONS
18}
19
20stop() {
21        [ -f $PID_F ] && kill $(cat $PID_F)
22}