Last active
June 18, 2018 12:37
-
-
Save penguinwokrs/3ad0054eff759e2709c13cc9025b97b2 to your computer and use it in GitHub Desktop.
通信速度を計測して、チャンネルに投稿するスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
res=$(speedtest --server 14623 --simple) | |
USERNAME="webhookbot" | |
CHANNEL="#speedtest" | |
ICON=":bike:" | |
WEBHOOK_URL="https://hooks.slack.com/services/ID" | |
author="author name" | |
data=`cat << EOF | |
payload={ | |
"channel": "$CHANNEL", | |
"username": "$USERNAME", | |
"icon_emoji": "$ICON", | |
"text": "${res}" | |
}] | |
} | |
EOF` | |
curl -X POST --data-urlencode "$data" $WEBHOOK_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment