Browse Source

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>
lilik-openwrt-22.03
Daniel Golle 9 years ago
parent
commit
1f312e49af
1 changed files with 19 additions and 14 deletions
  1. +19
    -14
      net/freeradius2/files/radiusd.init

+ 19
- 14
net/freeradius2/files/radiusd.init View File

@ -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
} }

Loading…
Cancel
Save