|
@ -1,22 +1,27 @@ |
|
|
#!/bin/sh /etc/rc.common |
|
|
#!/bin/sh /etc/rc.common |
|
|
# Copyright (C) 2006 OpenWrt.org |
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
# Copyright (C) 2006-2015 OpenWrt.org |
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
USE_PROCD=1 |
|
|
|
|
|
|
|
|
START=50 |
|
|
START=50 |
|
|
|
|
|
|
|
|
|
|
|
NAME=radiusd |
|
|
|
|
|
PROG=/usr/sbin/radiusd |
|
|
DEFAULT=/etc/default/radiusd |
|
|
DEFAULT=/etc/default/radiusd |
|
|
LOG_D=/var/log |
|
|
|
|
|
RUN_D=/var/run |
|
|
|
|
|
PID_F=$RUN_D/radiusd.pid |
|
|
|
|
|
RADACCT_D=/var/db/radacct |
|
|
|
|
|
IPADDR=$(ifconfig br-lan | sed -n 's/.*dr:\(.*\)Bc.*/\1/p') |
|
|
|
|
|
|
|
|
|
|
|
start() { |
|
|
|
|
|
|
|
|
start_service() |
|
|
|
|
|
{ |
|
|
[ -f $DEFAULT ] && . $DEFAULT |
|
|
[ -f $DEFAULT ] && . $DEFAULT |
|
|
mkdir -p $LOG_D |
|
|
|
|
|
mkdir -p $RUN_D |
|
|
|
|
|
mkdir -p $RADACCT_D |
|
|
|
|
|
radiusd -i $IPADDR -p 1812,1813 $OPTIONS |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
mkdir -p /var/log |
|
|
|
|
|
mkdir -p /var/run |
|
|
|
|
|
mkdir -p /var/db/radacct |
|
|
|
|
|
|
|
|
stop() { |
|
|
|
|
|
[ -f $PID_F ] && kill $(cat $PID_F) |
|
|
|
|
|
|
|
|
procd_open_instance |
|
|
|
|
|
procd_set_param command $PROG |
|
|
|
|
|
[ -n "$IPADDR" ] && procd_append_param command -i $IPADDR |
|
|
|
|
|
[ -n "$OPTIONS" ] && procd_append_param command $OPTIONS |
|
|
|
|
|
procd_set_param respawn |
|
|
|
|
|
procd_close_instance |
|
|
} |
|
|
} |