15 lines
414 B
Bash
Executable File
15 lines
414 B
Bash
Executable File
#!/bin/bash
|
|
|
|
sendmsg() {
|
|
chan="$1"
|
|
msg="${@:2}"
|
|
|
|
[[ ! $chan || ! $msg ]] && echo "Please select user and message." && exit 1
|
|
|
|
curl -s -H "X-Auth-Token: 9aHo-EZ4ySYv9reV7rwcRLxuOSWeATmKlyKRvwebIXa" \
|
|
-H "X-User-Id: HTuZCNhtoG4yQocCg" \
|
|
-H "Content-type:application/json" \
|
|
http://192.168.9.6:10140/api/v1/chat.postMessage \
|
|
-d "{ \"channel\": \"$chan\", \"text\": \"$msg\" }" > /dev/null 2>&1
|
|
}
|