Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #記得要先在configuration.yaml做以下設定讓tmp可對外才行唷!!
- #homeassistant:
- # allowlist_external_dirs:
- # - "/tmp"
- #修改成自己HA的IP:PORT,注意等號左右不能有空格唷!!
- DST=http://192.168.1.123:8123
- #Synology Chat source,網址記得去掉s並改用http的port,注意網址前後要用"符號包起來唷!!
- SYNOCHAT_SOURCE="http://192.168.1.100:5000/webapi/entry.cgi?api=SYNO.Chat.External&method=incoming&version=2&token=XXXXXXXXXXXXX"
- #通知內容
- msg="警告!!芮氏規模$1的地震,將於$2秒後到達!!"
- #截圖指令
- VNC=:0 gnome-screenshot -w -f /config/www/tmp/OX.png
- #發送Synology Chat通知
- curl -X POST \
- -d "payload={ \"text\":\" $msg \", \"file_url\":\"$DST/local/tmp/OX.png\" }" \
- $SYNOCHAT_SOURCE
- #等待1秒
- sleep 1s
- #刪除截圖
- rm -f /config/www/tmp/OX.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement