Last active
August 29, 2015 14:03
-
-
Save behinddesign/4c63f837bae8c515b6ec to your computer and use it in GitHub Desktop.
Autostart VMs - Make sure PfSense is running before launching anything else, then launch Plex and others if need be. Put files - C:\Windows\System32\GroupPolicy\Machine\Scripts\Startup and C:\Windows\System32\GroupPolicy\Machine\Scripts\Shutdown (replace start with stop or suspend)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@setlocal enableextensions enabledelayedexpansion | |
@echo off | |
set vmware_path="C:\Program Files (x86)\VMware\VMware Workstation" | |
set vms_path=C:\Users\MY_USERNAME_HERE\Documents\Virtual Machines | |
set ip_of_pfsense="PFSENSE_IP_HERE" | |
echo Starting VMS | |
echo ============ | |
echo - PFSense | |
<nul set /p = "- Waiting to boot " | |
%vmware_path%\vmrun start "%vms_path%\pfsense\PfSense.vmx" nogui | |
:loop | |
set state=down | |
ping -n 1 %ip_of_pfsense% | find "TTL" > nul | |
if not errorlevel 1 set state=up | |
if %state%==down ( | |
timeout 1 /nobreak > nul | |
<nul set /p =. | |
goto :loop | |
) | |
echo ... Booted | |
echo - Plex | |
%vmware_path%\vmrun start "%vms_path%\plex\Plex.vmx" nogui | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment