Skip to content

Commit 8b0dc1d

Browse files
shellrc: added mqtt plugin
1 parent 10de73a commit 8b0dc1d

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

.oh-my-shell/oh-my-shellrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ dot_plugin_if_exists "misc"
106106
dot_plugin_if_exists "minikube"
107107
dot_plugin_if_exists "music" # Requires: homelab
108108
dot_plugin_if_exists "mv"
109+
dot_plugin_if_exists "mqtt"
109110
dot_plugin_if_exists "navi"
110111
dot_plugin_if_exists "network"
111112
#dot_plugin_if_exists "nvm" # Node.js environment manager FIXME: remove plugin
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Usage: mqtt_send_anon_message "localhost" "1883" "mytopic/" "my message"
2+
alias mqtt_send_anon_message="f_mqtt_send_anonymous_message"
3+
4+
# Usage: tmqtt "mqtt://test.mosquitto.org" "hello/world"
5+
alias tmqtt='mqttui --broker '
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function f_mqtt_send_anonymous_message() {
2+
local host="$1"
3+
local port="$2"
4+
local topic="$3"
5+
local message="$4"
6+
7+
mqttx pub -t "$topic" -q 1 -h "$host" -p "$port" -m "$message"
8+
}

0 commit comments

Comments
 (0)