This repository has been archived on 2023-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
bog-bbot-archive/src/shell/functions.sh

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
}