mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
freeradius2: cleanup init script
The initscript originally imported from oldpackages no longer does the job, sed'ery around ifconfig is just not the way. Remove stuff which can also be done via /etc/freeradius2/* or /etc/default/radiusd instead. Fixes #1769 and #1193 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
@@ -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 /var/log
|
||||||
mkdir -p $RUN_D
|
mkdir -p /var/run
|
||||||
mkdir -p $RADACCT_D
|
mkdir -p /var/db/radacct
|
||||||
radiusd -i $IPADDR -p 1812,1813 $OPTIONS
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
procd_open_instance
|
||||||
[ -f $PID_F ] && kill $(cat $PID_F)
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user