pve admin tooling

This commit is contained in:
2025-08-02 16:49:43 +03:00
parent 898d733ebf
commit d4ebd93920
10 changed files with 254 additions and 1 deletions

View 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

View 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
}