Skip to content

Instantly share code, notes, and snippets.

@ArtiomL
Created January 3, 2013 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArtiomL/4440036 to your computer and use it in GitHub Desktop.
Save ArtiomL/4440036 to your computer and use it in GitHub Desktop.
Reals - Multi-Server Launcher Script
@echo off
REM Reals - Multi-Server Launcher Script
REM (CC0) No Rights Reserved
REM Artiom Lichtenstein
REM v1.3, 03/01/2013
if [%1]==[] goto proghelp
if [%2]==[] goto proghelp
if [%3]==[] goto proghelp
setlocal EnableDelayedExpansion
set str_PATH="C:\Program Files (x86)\Network Tools\QuickPHP\"
set str_ROOT="C:\Program Files (x86)\Network Tools\QuickPHP\root\"
set str_NIC="VMware Network Adapter VMnet2"
cd /D %str_PATH%
netsh interface set interface %str_NIC% enabled > nul
netsh interface ipv4 set address %str_NIC% dhcp > nul
REM Extract IP Address Octets
for /f "tokens=1,2,3,4 delims=." %%a in ("%1") do set oct1=%%a&set oct2=%%b&set oct3=%%c&set oct4=%%d
REM Set IP Addresses
for /L %%i in (1,1,%3) do (
set ipaddr=%oct1%.%oct2%.%oct3%.!oct4!
netsh interface ipv4 add address %str_NIC% !ipaddr! 255.255.255.0
echo Setting...
REM Test IP Address
call:IPTest !ipaddr!
echo Done. Launching the Server.
REM Launch the Server
start quickphp.exe /Bind=!ipaddr! /Port=%2 /Root=%str_ROOT% /ShowTrayIcon=false /NoConfirm=true /Minimized /Start
set /a oct4=oct4+1
)
echo.
echo Great Success^^!
echo.
goto endprog
:IPTest
:while
ipconfig | find "%~1"
if ERRORLEVEL 1 goto :while
goto:eof
:proghelp
cls
echo.
echo ÛÛÛÛÛ Reals v1.3 ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
echo Û Û
echo Û Usage: reals a.b.c.d p n Û
echo Û Û
echo ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
echo Û Û
echo Û Where: a.b.c.d First Real Server's IP Address Û
echo Û p TCP Port Û
echo Û n Number of Real Servers to Run Û
echo Û Û
echo ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
echo.
:endprog
REM Powered by QuickPHP
REM Copyright © 2008-2013 Zach Saw
REM All Rights Reserved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment