mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
dmcli: support 'user' profile
This commit is contained in:
parent
910803ca61
commit
f8182a167c
4 changed files with 36 additions and 5 deletions
|
|
@ -11,12 +11,12 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=dmcli
|
||||
PKG_LICENSE:=PROPRIETARY GENEXIS
|
||||
PKG_VERSION:=1.10.0
|
||||
PKG_VERSION:=1.10.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/gnx/dmcli.git
|
||||
PKG_SOURCE_VERSION:=6144c106e9a48a23b527e79308ca210ff10ac574
|
||||
PKG_SOURCE_VERSION:=003402b804e4a0c0d640637cbbb2ee7809004b5c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
|
|
|||
|
|
@ -2,3 +2,8 @@ user operator
|
|||
topic read /usp/operator/controller/reply-to
|
||||
topic read /usp/operator/controller
|
||||
topic write /usp/operator/endpoint
|
||||
|
||||
user user
|
||||
topic read /usp/000F94-${SerialNumber}/user/controller/reply-to
|
||||
topic read /usp/000F94-${SerialNumber}/user/controller
|
||||
topic write /usp/000F94-${SerialNumber}/user/endpoint
|
||||
|
|
|
|||
|
|
@ -1,19 +1,33 @@
|
|||
{
|
||||
"Settings": {
|
||||
"USP": {
|
||||
"ActiveConnectionProfile": "local",
|
||||
"ActiveConnectionProfile": "operator",
|
||||
"ConnectionProfile": [
|
||||
{
|
||||
"Name": "local",
|
||||
"Name": "operator",
|
||||
"Host": "127.0.0.1",
|
||||
"Port": 9002,
|
||||
"Username": "operator",
|
||||
"Protocol": "ws",
|
||||
"FromId": "oui:000F94:device-controller-operator",
|
||||
"PublishEndpoint": "/usp/operator/endpoint",
|
||||
"SubscribeEndpoint": "/usp/operator/controller"
|
||||
"SubscribeEndpoint": "/usp/operator/controller",
|
||||
"ToId": "os::000F94-${SerialNumber}"
|
||||
},
|
||||
{
|
||||
"Name": "user",
|
||||
"Host": "127.0.0.1",
|
||||
"Port": 9002,
|
||||
"Username": "user",
|
||||
"Password": "${UserPassword}",
|
||||
"Protocol": "ws",
|
||||
"FromId": "self::sulu-user",
|
||||
"PublishEndpoint": "/usp/000F94-${SerialNumber}/user/endpoint",
|
||||
"SubscribeEndpoint": "/usp/000F94-${SerialNumber}/user/controller",
|
||||
"ToId": "os::000F94-${SerialNumber}"
|
||||
}
|
||||
],
|
||||
"Timeout": 30,
|
||||
"Session": {
|
||||
"AutoStart": false
|
||||
},
|
||||
|
|
|
|||
|
|
@ -35,6 +35,18 @@ uci -q set users.operator.enabled=1
|
|||
uci -q set users.operator.shell='dmcli'
|
||||
uci -q set users.operator.member_roles='operator'
|
||||
|
||||
# fix SerialNumber and UserPassword for 'user' acl and conf
|
||||
serial_number="$(fw_printenv SerialNumber -n 2>/dev/null)"
|
||||
if [ -n "${serial_number}" ]; then
|
||||
sed -i "s/\${SerialNumber}/${serial_number}/g" /etc/dmcli/dmcli.acl
|
||||
sed -i "s/\${SerialNumber}/${serial_number}/g" /etc/dmcli/dmcli.conf
|
||||
fi
|
||||
|
||||
user_password="$(fw_printenv UserPassword -n 2>/dev/null)"
|
||||
if [ -n "${user_password}" ]; then
|
||||
sed -i "s/\${UserPassword}/${user_password}/g" /etc/dmcli/dmcli.conf
|
||||
fi
|
||||
|
||||
if [ -f "/etc/config/mosquitto" ]; then
|
||||
uci_add mosquitto listener dmcli_local
|
||||
uci_set mosquitto dmcli_local enabled 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue