Merge pull request #81 from lynxis/nodogsplash_uci_config
Nodogsplash uci config
This commit is contained in:
commit
09cd03cd56
2 changed files with 57 additions and 19 deletions
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
|||
PKG_NAME:=nodogsplash
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_VERSION:=0.9_beta9.9.9
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
|
|
|
@ -30,19 +30,34 @@ nolog() {
|
|||
logger -s -t nodogsplash -p daemon.$level $@
|
||||
}
|
||||
|
||||
# append_config_option <cfgfile> <uci_cfg_obj> <option_name> <config_counterpart> [<optional default>]
|
||||
# append_config_option_map <cfgfile> <uci_cfg_obj> <option_name> <config_counterpart> [<optional default>]
|
||||
# append "$config_counterpart $value" to cfgfile if option_name exists
|
||||
# e.g. append_config_option "$CONFIGFILE" "$cfg" bind_address BindAddress 0.0.0.0
|
||||
# will append "BindAddress 192.168.1.1" if uci bind_address is '192.168.1.1'
|
||||
append_config_option() {
|
||||
append_config_option_map() {
|
||||
local val=""
|
||||
local cfg="$1"
|
||||
local config_file="$2"
|
||||
local config_file="$1"
|
||||
local cfg="$2"
|
||||
local option_name="$3"
|
||||
local config_counterpart="$4"
|
||||
local default="$5"
|
||||
config_get val "$cfg" "$option_name" "$default"
|
||||
[ -n "$val" ] && echo "" >> $config_file
|
||||
[ -n "$val" ] && echo "$config_counterpart $val" >> $config_file
|
||||
}
|
||||
|
||||
# append_config_option <cfgfile> <uci_cfg_obj> <option_name> [<optional default>]
|
||||
# append "$option_name $value" to cfgfile if option_name exists
|
||||
# e.g. append_config_option "$CONFIGFILE" "$cfg" bind_address 0.0.0.0
|
||||
# will append "bind_address 192.168.1.1" if uci bind_address is '192.168.1.1'
|
||||
# if uci bind_address is unset append "bind_address 0.0.0.0"
|
||||
append_config_option() {
|
||||
local val=""
|
||||
local config_file="$1"
|
||||
local cfg="$2"
|
||||
local option_name="$3"
|
||||
local default="$4"
|
||||
config_get val "$cfg" "$option_name" "$default"
|
||||
[ -n "$val" ] && echo "$option_name $val" >> $config_file
|
||||
}
|
||||
|
||||
setup_user_authentication() {
|
||||
|
@ -168,19 +183,42 @@ generate_uci_config() {
|
|||
|
||||
echo "GatewayInterface $ifname" >> $CONFIGFILE
|
||||
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayname GatewayName
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayaddress GatewayAddress
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayport GatewayPort
|
||||
append_config_option "$CONFIGFILE" "$cfg" maxclients MaxClients
|
||||
append_config_option "$CONFIGFILE" "$cfg" imagedir ImagesDir
|
||||
append_config_option "$CONFIGFILE" "$cfg" redirecturl RedirectURL
|
||||
append_config_option "$CONFIGFILE" "$cfg" clientidletimeout ClientIdleTimeout
|
||||
append_config_option "$CONFIGFILE" "$cfg" clientforcetimeout ClientForceTimeout
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayiprange GatewayIPRange
|
||||
append_config_option "$CONFIGFILE" "$cfg" passwordattempts PasswordAttempts
|
||||
append_config_option "$CONFIGFILE" "$cfg" macmechanism MACMechanism
|
||||
append_config_option "$CONFIGFILE" "$cfg" uploadlimit UploadLimit
|
||||
append_config_option "$CONFIGFILE" "$cfg" downloadlimit DownloadLimit
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayname
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayaddress
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayport
|
||||
append_config_option "$CONFIGFILE" "$cfg" maxclients
|
||||
append_config_option "$CONFIGFILE" "$cfg" webroot
|
||||
append_config_option "$CONFIGFILE" "$cfg" debuglevel
|
||||
append_config_option "$CONFIGFILE" "$cfg" splashpage
|
||||
append_config_option "$CONFIGFILE" "$cfg" pagesdir
|
||||
append_config_option "$CONFIGFILE" "$cfg" checkinterval
|
||||
append_config_option "$CONFIGFILE" "$cfg" syslogfacility
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayiprange
|
||||
append_config_option "$CONFIGFILE" "$cfg" imagedir
|
||||
append_config_option "$CONFIGFILE" "$cfg" redirecturl
|
||||
append_config_option "$CONFIGFILE" "$cfg" clientidletimeout
|
||||
append_config_option "$CONFIGFILE" "$cfg" clientforcetimeout
|
||||
append_config_option "$CONFIGFILE" "$cfg" gatewayiprange
|
||||
append_config_option "$CONFIGFILE" "$cfg" passwordattempts
|
||||
append_config_option "$CONFIGFILE" "$cfg" macmechanism
|
||||
append_config_option "$CONFIGFILE" "$cfg" uploadlimit
|
||||
append_config_option "$CONFIGFILE" "$cfg" downloadlimit
|
||||
append_config_option "$CONFIGFILE" "$cfg" remoteauthenticatoraction
|
||||
append_config_option "$CONFIGFILE" "$cfg" enablepreauth
|
||||
append_config_option "$CONFIGFILE" "$cfg" binvoucher
|
||||
append_config_option "$CONFIGFILE" "$cfg" forcevoucher
|
||||
append_config_option "$CONFIGFILE" "$cfg" passwordauthentication
|
||||
append_config_option "$CONFIGFILE" "$cfg" usernameauthentication
|
||||
append_config_option "$CONFIGFILE" "$cfg" passwordattempts
|
||||
append_config_option "$CONFIGFILE" "$cfg" username
|
||||
append_config_option "$CONFIGFILE" "$cfg" password
|
||||
append_config_option "$CONFIGFILE" "$cfg" authenticateimmediately
|
||||
append_config_option "$CONFIGFILE" "$cfg" decongesthttpdthreads
|
||||
append_config_option "$CONFIGFILE" "$cfg" httpdthreadthreshold
|
||||
append_config_option "$CONFIGFILE" "$cfg" httpdthreaddelayms
|
||||
append_config_option "$CONFIGFILE" "$cfg" fw_mark_authenticated
|
||||
append_config_option "$CONFIGFILE" "$cfg" fw_mark_trusted
|
||||
append_config_option "$CONFIGFILE" "$cfg" fw_mark_blocked
|
||||
|
||||
config_get download "$cfg" downloadlimit
|
||||
config_get upload "$cfg" uploadlimit
|
||||
|
|
Loading…
Reference in a new issue