34 lines
770 B
Bash
Executable File
34 lines
770 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# powerwall - CLI commands to control VM guest power
|
|
|
|
action="$1"
|
|
FOLDER='/opt/idssys/powerwall'
|
|
VERS='1.030921'
|
|
|
|
|
|
source /opt/idssys/powerwall/defaults.inc
|
|
source /opt/idssys/powerwall/powerwall.conf
|
|
source /opt/idssys/defaults/colors.inc
|
|
source /opt/idssys/defaults/default.inc
|
|
|
|
#ssh root@10.5.10.35 '/vmfs/volumes/NFS_ESXi-Vault/esxi-shutdown.sh > /dev/null 2>&1' & > /dev/null 2>&1
|
|
|
|
GETTEMP(){
|
|
mqtt_message=$(`mosquitto_sub -h 10.10.1.180 -t tasmota/discovery/${1}/sensors -u homeassistant -P 12home34assistant56`)
|
|
echo $payload | cut -d':' -f 7 | cut -d',' -f 1 | read temp_c
|
|
temp_f=`echo "scale=2; $temp*1.8 + 32" | bc`
|
|
|
|
echo "$temp_c -> $tempf"
|
|
}
|
|
|
|
|
|
|
|
|
|
if [ ${action-x} ]; then
|
|
case $action in
|
|
gettemp) GETTEMP ${2};;
|
|
|
|
esac
|
|
fi
|
|
|
|
exit 0 |