xmppc: 2.0.0

This commit is contained in:
Amin Ben Ramdhane 2022-04-28 16:23:20 +01:00 committed by Vivek Kumar Dutta
parent 768304c5a1
commit e82294aa2f
3 changed files with 25 additions and 23 deletions

View file

@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xmppc
PKG_VERSION:=1.0.3
PKG_VERSION:=2.0.0
PKG_SOURCE_VERSION:=4a09b8689d67dcbf3fd1b7e80e53816b7cd12614
PKG_SOURCE_VERSION:=5311b96747e54ee4eda5a77c30d34754f927fde6
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/xmppc.git
@ -29,7 +29,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF xmpp Client
DEPENDS:=+libuci +libubox +libstrophe +libbbf_api +libubus
DEPENDS:=+libuci +libubox +libstrophe +libubus
endef
define Package/$(PKG_NAME)/description

View file

@ -1,13 +1,11 @@
config xmpp 'xmpp'
option enable '0'
option id '0'
option conn_req_connection 'connection_1'
option allowed_jid ''
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
option loglevel '3'
config connection
option xmpp_id '1'
config connection 'connection_1'
option enable '0'
option username ''
option password ''
@ -21,9 +19,19 @@ config connection
option retry_max_interval '1'
option serveralgorithm 'DNS-SRV'
config connection_server
option con_id '1'
config connection_server 'connection_1_srv_1'
option con_name 'connection_1'
option enable '0'
option priority '0'
option weight '-1'
option port '5222'
option server_address ''
config connection_server 'connection_1_srv_2'
option con_name 'connection_1'
option enable '0'
option priority '0'
option weight '-1'
option port '5222'
option server_address ''

View file

@ -7,20 +7,13 @@ USE_PROCD=1
PROG="/usr/sbin/xmppc"
start_service() {
local xmpp_enable=`uci -q get xmpp.xmpp.enable`
local xmpp_id=`uci -q get xmpp.xmpp.id`
if ([ "$xmpp_enable" = "1" ] && [ "$xmpp_id" != "0" ]); then
local con=`uci show xmpp | grep "xmpp.@connection.*xmpp_id=\'$xmpp_id\'" | cut -d "." -f 2`
local con_srv=`uci show xmpp | grep "xmpp.@connection.*con_id=\'$xmpp_id\'" | cut -d "." -f 2`
local serveralgorithm=`uci get xmpp.$con.serveralgorithm`
local con_enable=`uci -q get xmpp.$con.enable`
local srv_enable=`uci -q get xmpp.$con_srv.enable`
if ([ "$serveralgorithm" = "DNS-SRV" ] && [ "$con_enable" = "1" ]) || ([ "$serveralgorithm" = "ServerTable" ] && [ "$con_enable" = "1" ] && [ "$srv_enable" = "1" ]); then
procd_open_instance xmppc
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
procd_close_instance
fi
local con_name=$(uci -q get xmpp.xmpp.conn_req_connection)
local con_enable=$(uci -q get xmpp.$con_name.enable)
if [ "$con_enable" == "1" ]; then
procd_open_instance
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
procd_close_instance
fi
}
@ -29,6 +22,7 @@ boot() {
}
reload_service() {
logger -p crit -t "xmppc" "reloading service()"
stop
start
}