chore(M00): 补齐WSL EMQX辅助入口
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
echo "INFO: checking WSL local EMQX through the MQTT baseline"
|
||||
"${SCRIPT_DIR}/check-local-mqtt.sh"
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "INFO: starting WSL local EMQX service"
|
||||
|
||||
if ! command -v systemctl >/dev/null 2>&1; then
|
||||
echo "FAIL: systemctl not found; start EMQX manually in this WSL environment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! dpkg-query -W emqx >/dev/null 2>&1; then
|
||||
echo "FAIL: emqx package not found; this script does not install or reset EMQX"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if systemctl is-active --quiet emqx; then
|
||||
echo "PASS: emqx service already active"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo systemctl start emqx
|
||||
systemctl is-active --quiet emqx && echo "PASS: emqx service active" || {
|
||||
echo "FAIL: emqx service did not become active"
|
||||
exit 1
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "INFO: stopping WSL local EMQX service"
|
||||
|
||||
if ! command -v systemctl >/dev/null 2>&1; then
|
||||
echo "FAIL: systemctl not found; stop EMQX manually in this WSL environment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! dpkg-query -W emqx >/dev/null 2>&1; then
|
||||
echo "FAIL: emqx package not found; nothing to stop"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! systemctl is-active --quiet emqx; then
|
||||
echo "PASS: emqx service already inactive"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sudo systemctl stop emqx
|
||||
if systemctl is-active --quiet emqx; then
|
||||
echo "FAIL: emqx service is still active"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "PASS: emqx service stopped"
|
||||
Reference in New Issue
Block a user