Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
42
package/network/services/hostapd/files/radius.init
Normal file
42
package/network/services/hostapd/files/radius.init
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=30
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=radius
|
||||
|
||||
radius_start() {
|
||||
local cfg="$1"
|
||||
|
||||
config_get_bool disabled "$cfg" disabled 0
|
||||
|
||||
[ "$disabled" -gt 0 ] && return
|
||||
|
||||
config_get ca "$cfg" ca_cert
|
||||
config_get key "$cfg" key
|
||||
config_get cert "$cfg" cert
|
||||
config_get users "$cfg" users
|
||||
config_get clients "$cfg" clients
|
||||
config_get auth_port "$cfg" auth_port 1812
|
||||
config_get acct_port "$cfg" acct_port 1813
|
||||
config_get identity "$cfg" identity "$(cat /proc/sys/kernel/hostname)"
|
||||
|
||||
procd_open_instance $cfg
|
||||
procd_set_param command /usr/sbin/hostapd-radius \
|
||||
-C "$ca" \
|
||||
-c "$cert" -k "$key" \
|
||||
-s "$clients" -u "$users" \
|
||||
-p "$auth_port" -P "$acct_port" \
|
||||
-i "$identity"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load radius
|
||||
config_foreach radius_start radius
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "radius"
|
||||
}
|
||||
Reference in New Issue
Block a user