pve admin tooling
This commit is contained in:
8
proxmox/templates/telegram.env.j2
Normal file
8
proxmox/templates/telegram.env.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
tg_token='{{ tgtoken }}'
|
||||
chatid='{{ tgchatid }}'
|
||||
|
||||
function tgmsg {
|
||||
clustername="$(pvesh get /cluster/status --output-format json | jq -r '.[] | select(.id == "cluster") | .name')"
|
||||
curl -X POST -H 'Content-Type: application/json' -d '{"chat_id": "'"${chatid}"'", "text": "'"$HOSTNAME@$clustername: $1"'"}' https://api.telegram.org/bot$tg_token/sendMessage
|
||||
}
|
Reference in New Issue
Block a user