mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
xmpp: optimize xmpp uci map
This commit is contained in:
parent
4ee9169771
commit
c1fe6b05a6
3 changed files with 11 additions and 29 deletions
|
|
@ -8,13 +8,13 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=xmppc
|
PKG_NAME:=xmppc
|
||||||
PKG_VERSION:=2.2.12
|
PKG_VERSION:=2.2.13
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
||||||
PKG_SOURCE_VERSION:=8a494c51bff8190bf78636220115c003b0b34a51
|
PKG_SOURCE_VERSION:=5dc59fec17f9259ce40959b3fc0fc344322d5435
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
PKG_MIRROR_HASH:=skip
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
config xmpp 'xmpp'
|
config xmpp 'xmpp'
|
||||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||||
option loglevel '3'
|
option loglevel '2'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,13 @@ STOP=10
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
PROG="/usr/sbin/xmppc"
|
PROG="/usr/sbin/xmppc"
|
||||||
|
|
||||||
stop_service() {
|
start_service() {
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command "$PROG"
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
xmpp_running="$(ubus call service list '{"name":"xmppc"}' | jq ".xmppc.instances.instance1.running")"
|
xmpp_running="$(ubus call service list '{"name":"xmppc"}' | jq ".xmppc.instances.instance1.running")"
|
||||||
if [ "${xmpp_running}" = "true" ]; then
|
if [ "${xmpp_running}" = "true" ]; then
|
||||||
procd_send_signal xmppc '*' SIGKILL
|
procd_send_signal xmppc '*' SIGKILL
|
||||||
|
|
@ -16,31 +22,7 @@ stop_service() {
|
||||||
uci -q -c /var/state delete xmppc.conn_status
|
uci -q -c /var/state delete xmppc.conn_status
|
||||||
uci -q -c /var/state commit xmppc
|
uci -q -c /var/state commit xmppc
|
||||||
fi
|
fi
|
||||||
}
|
start
|
||||||
|
|
||||||
start_service() {
|
|
||||||
local con_name=$(uci -q get xmpp.xmpp.conn_req_connection)
|
|
||||||
local con_enable=$(uci -q get xmpp."${con_name}".enable)
|
|
||||||
|
|
||||||
if [ ! -f "/var/state/xmppc" ]; then
|
|
||||||
touch "/var/state/xmppc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
uci -q -c /var/state set xmppc.global='global'
|
|
||||||
uci -q -c /var/state set xmppc.global.last_change="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
|
||||||
uci -q -c /var/state commit xmppc
|
|
||||||
|
|
||||||
procd_open_instance
|
|
||||||
if [ "$con_enable" = "1" ]; then
|
|
||||||
procd_set_param command "$PROG"
|
|
||||||
fi
|
|
||||||
procd_close_instance
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_service() {
|
|
||||||
logger -p crit -t "xmppc" "reloading service()"
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
}
|
||||||
|
|
||||||
service_triggers()
|
service_triggers()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue