Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
iot-mqtt-bl
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
deploy
iot-mqtt-bl
Commits
1b437060
Commit
1b437060
authored
Apr 27, 2023
by
吴文龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用环境变量配置端口及凭证
parent
664db082
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
docker-compose.yml
docker-compose.yml
+2
-0
check_mqtt.sh
haproxy/data/check_mqtt.sh
+1
-1
test-mqtt.json
haproxy/data/test-mqtt.json
+1
-1
No files found.
docker-compose.yml
View file @
1b437060
...
...
@@ -17,4 +17,6 @@ services:
-
NET_ADMIN
environment
:
MQTT_PORT
:
1883
TB_MQTT_PORT
:
31883
TB_ACCESS_TOKEN
:
'
123456'
FORCE_HTTPS_REDIRECT
:
"
false"
haproxy/data/check_mqtt.sh
View file @
1b437060
#!/bin/sh
echo
$@
>>
/tmp/all_arguments.txt
ip_adr
=
$(
echo
$@
|awk
'{print $3}'
)
if
mosquitto_pub
-h
$ip_adr
-p
31883
-u
123456
-t
v1/devices/me/attributes
-f
/usr/local/bin/test-mqtt.json
-q
1
-d
;
then
if
mosquitto_pub
-h
$ip_adr
-p
${
TB_MQTT_PORT
}
-u
${
TB_ACCESS_TOKEN
}
-t
v1/devices/me/attributes
-f
/usr/local/bin/test-mqtt.json
-q
1
-d
;
then
exit
0
else
exit
1
...
...
haproxy/data/test-mqtt.json
View file @
1b437060
{
"check-mqtt"
:
"ok"
}
\ No newline at end of file
{
"check-mqtt-status"
:
"ok"
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment