pve admin tooling
This commit is contained in:
10
proxmox/templates/broadcast_reboot.service
Normal file
10
proxmox/templates/broadcast_reboot.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Broadcasts boot
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/root/admin_scripts/broadcast_reboot.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
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