diff --git a/defaults.inc b/defaults.inc index 938ac7a9..b09f0700 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='2.5.230-02012024' +VERS='2.5.231-02012024' noheader=' update service dailytemp confsync -r -report ' diff --git a/esxi-scripts/vm-shutdown.ps1 b/esxi-scripts/vm-shutdown.ps1 index 5ababde6..e84a6bf1 100755 --- a/esxi-scripts/vm-shutdown.ps1 +++ b/esxi-scripts/vm-shutdown.ps1 @@ -6,9 +6,7 @@ Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Passwo $vmhosts=$args[0].Split(",") Foreach ($vmhost in $vmhosts) { - # Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false - write-host $vmhost - Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} + Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false } Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false diff --git a/powerwall.sh b/powerwall.sh index 3b4f0a9c..0f8747d5 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -11,7 +11,7 @@ source /opt/idssys/powerwall/inc/power.inc.sh source /opt/idssys/powerwall/inc/temp.inc.sh -TEST=true +# TEST=true shopt -s lastpipe @@ -416,15 +416,14 @@ SHUTDOWN_SERVER(){ echo fi - MSG="Shutting down remaining VM's on: ${PW_ESXI_HOST_NAMES[${ESXIHOST}]}" + MSG="Shutting down any remaining VM's" c=0; MSG_SPC=''; spc1=`expr ${HC_CW} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done echo -en "${idsCL[White]}${MSG//${PW_ESXI_HOST_NAMES[${ESXIHOST}]}/${idsCL[LightCyan]}${PW_ESXI_HOST_NAMES[${ESXIHOST}]}}${idsCL[White]}${MSG_SPC}: " - if [ "${TEST}" != "trueXXXXXX" ]; then + if [ "${TEST}" != "true" ]; then for ESXIHOST in "${ESXI_HOSTS[@]}"; do varvms="${PW_VCENTER_HOST_NAMES[${ESXIHOST}]},${varvms}" done - echo "HERE: ${varvms::-1}" - ${PW_FOLDER}/esxi-scripts/vm-shutdown.ps1 "${varvms::-1}" #>/dev/null 2>&1 & + ${PW_FOLDER}/esxi-scripts/vm-shutdown.ps1 "${varvms::-1}" >/dev/null 2>&1 & echo -e "${idsCL[Green]}Commands sent${idsCL[Default]}" else