send message to TelegramBot chat room
參考官方手冊。原則上只需要:
在您的 Linux 環境中:
- 下載 telegram_notify.sh
curl -s -k https://raw.githubusercontent.com/andrewintw/telegram-notify/main/telegram_notify.sh \ -o /usr/local/sbin/telegram_notify.sh
chmod a+x /usr/local/sbin/telegram_notify.sh
- 修改 token
vim /usr/local/sbin/telegram_notify.sh 或 nano /usr/local/sbin/telegram_notify.sh
- 修改
token="123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
取代為你自己的 token
- 修改
telegram_notify.sh <訊息>
ex: 執行下面的指令,然後看看 telegram app 有沒有收到訊息
telegram_notify.sh "Hello, send from $(hostname)"