update
This commit is contained in:
@@ -3,7 +3,18 @@
|
|||||||
|
|
||||||
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null
|
||||||
|
|
||||||
Get-VM | Where {$_.Name -like '*MySQL-Node2*' -or $_.Name -like '*Webserver-Node1*' -or $_.Name -like '*LB-Node2*' -or $_.Name -like '*UniFi-Camera-Proxy*' -or $_.Name -like '*Internet Monitor*' -or $_.Name -like '*OMSA*' -or $_.Name -like '*RustDesk Server*' -or $_.Name -like '*Fileserver*' -or $_.Name -like '*UrBackup*'} | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*Offsite-Backups*'} | Shutdown-VMGuest -Confirm:$false
|
Get-VM | Where {
|
||||||
|
$_.Name -like '*MySQL-Node2*'
|
||||||
|
-or $_.Name -like '*Webserver-Node1*'
|
||||||
|
-or $_.Name -like '*LB-Node2*'
|
||||||
|
-or $_.Name -like '*UniFi-Camera-Proxy*'
|
||||||
|
-or $_.Name -like '*Internet Monitor*'
|
||||||
|
-or $_.Name -like '*OMSA*'
|
||||||
|
-or $_.Name -like '*RustDesk Server*'
|
||||||
|
-or $_.Name -like '*Fileserver*'
|
||||||
|
-or $_.Name -like '*UrBackup*'
|
||||||
|
-or $_.Name -like '*MySQL-Manager*'
|
||||||
|
} | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*Offsite-Backups*'} | Shutdown-VMGuest -Confirm:$false
|
||||||
|
|
||||||
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|
||||||
|
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ SHUTDOWN_SERVER(){
|
|||||||
c=0; MSG_SPC=''; spc1=`expr ${HC_CW} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
c=0; MSG_SPC=''; spc1=`expr ${HC_CW} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
|
||||||
echo -en "${idsCL[White]}${MSG}${MSG_SPC}: "
|
echo -en "${idsCL[White]}${MSG}${MSG_SPC}: "
|
||||||
if [ "${TEST}" != "true" ]; then
|
if [ "${TEST}" != "true" ]; then
|
||||||
sleep 45s
|
sleep 60s # up from 45s
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
else
|
else
|
||||||
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
echo -e "${idsCL[Yellow]}(TEST MODE)${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user