fix stuff
This commit is contained in:
parent
5f092305f7
commit
2332625953
|
@ -66,3 +66,6 @@ package-lock.json
|
|||
|
||||
# Memo
|
||||
memo.txt
|
||||
|
||||
# BoG
|
||||
src/shell/.env
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
API_TOKEN=""
|
||||
API_ID=""
|
|
@ -1,14 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
|
||||
[[ -n $MY_PATH/.env ]] && source $MY_PATH/.env || (echo "Please create $MY_PATH/.env as $MY_PATH/.env.example" && exit 1)
|
||||
|
||||
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" \
|
||||
curl -s -H "X-Auth-Token: $API_TOKEN" \
|
||||
-H "X-User-Id: $API_ID" \
|
||||
-H "Content-type:application/json" \
|
||||
http://192.168.9.6:10140/api/v1/chat.postMessage \
|
||||
-d "{ \"channel\": \"$chan\", \"text\": \"$msg\" }" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
$@
|
||||
|
||||
|
|
Reference in New Issue