Last active
March 1, 2022 04:37
-
-
Save eveyrat/9428342 to your computer and use it in GitHub Desktop.
windows shell script - add hosts entries
This file contains hidden or 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
@echo off | |
SET NEWLINE=^& echo. | |
ECHO %NEWLINE%^ >>%WINDIR%\System32\drivers\etc\hosts | |
FIND /C /I "heracles.fila" %WINDIR%\system32\drivers\etc\hosts | |
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 heracles.fila>>%WINDIR%\System32\drivers\etc\hosts | |
FIND /C /I "www.heracles.fila" %WINDIR%\system32\drivers\etc\hosts | |
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 www.heracles.fila>>%WINDIR%\System32\drivers\etc\hosts | |
FIND /C /I "api.heracles.fila" %WINDIR%\system32\drivers\etc\hosts | |
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 api.heracles.fila>>%WINDIR%\System32\drivers\etc\hosts | |
FIND /C /I "bracket.heracles.fila" %WINDIR%\system32\drivers\etc\hosts | |
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 bracket.heracles.fila>>%WINDIR%\System32\drivers\etc\hosts | |
FIND /C /I "onvenue.heracles.fila" %WINDIR%\system32\drivers\etc\hosts | |
IF %ERRORLEVEL% NEQ 0 ECHO %NEWLINE%^192.168.5.10 bracket.heracles.onvenue>>%WINDIR%\System32\drivers\etc\hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment