mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-10 11:17:16 +01:00
obuspa: reduce ubus calls to uspd
- Reduce number of ubus calls to uspd on obuspa_get - Add uci option to enable/disable obuspa
This commit is contained in:
parent
871a3c3907
commit
1335405ccc
3 changed files with 9 additions and 3 deletions
|
|
@ -5,10 +5,10 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=2.0.0
|
||||
PKG_VERSION:=2.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9c7921c8e39acfc31f563bd08220faba1012a834
|
||||
PKG_SOURCE_VERSION:=ae498582d76a138fdd7b77d413a9a035d3987403
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
# details, always defined in groups
|
||||
|
||||
config obuspa
|
||||
option enable 'true'
|
||||
option cert '/etc/obuspa/rootCA.pem'
|
||||
option interface 'wan'
|
||||
option debug 'false'
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ db_set() {
|
|||
validate_obuspa_section()
|
||||
{
|
||||
uci_validate_section obuspa obuspa "${1}" \
|
||||
'enable:bool:true' \
|
||||
'cert:string:"/etc/obuspa/rootCA.pem"' \
|
||||
'interface:string:wan' \
|
||||
'debug:bool:false'
|
||||
|
|
@ -163,13 +164,17 @@ configure_connection() {
|
|||
}
|
||||
|
||||
configure_obuspa() {
|
||||
local cert interface debug
|
||||
local enable cert interface debug
|
||||
|
||||
validate_obuspa_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ ${enable} -eq 0 ] && \
|
||||
echo "obuspa not enabled" >>/dev/console && \
|
||||
exit
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue