2022-05-15 13:55:11 +02:00

19 lines
523 B
Bash

#!/bin/bash
# ___ _ _ _ __
# / __|| |_ | |_ ___ | '_ \ ___
# \__ \| _|| \ / _ \| .__// -_)
# |___/ \__||_||_|\___/|_| \___|
MQTT_BROKER="${MQTT_BROKER:-192.168.100}";
USERNAME="${USERNAME:-mosquitto}";
PASSWORD="${PASSWORD:-insecurebydefault}";
PROXMOX_NAME="${PROXMOX_NAME:-pve}";
tempvar=$(cat /temp);
TEMP=$(expr $tempvar / 1000)
while :
do
mosquitto_pub -h "${MQTT_BROKER}" -u "${USERNAME}" -P "${PASSWORD}" -t proxmox/"${PROXMOX_NAME}"/cpu_temp -m "${TEMP}"
sleep 1m
done