mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-2140 Check OS for SMB or NFS folder strategy
This commit is contained in:
23
resources/ansible/inventories/GetIpAdresses.cmd
Normal file
23
resources/ansible/inventories/GetIpAdresses.cmd
Normal file
@@ -0,0 +1,23 @@
|
||||
@echo off
|
||||
setlocal
|
||||
setlocal enabledelayedexpansion
|
||||
rem throw away everything except the IPv4 address line
|
||||
for /f "usebackq tokens=*" %%a in (`ipconfig ^| findstr /i "ipv4"`) do (
|
||||
rem we have for example "IPv4 Address. . . . . . . . . . . : 192.168.42.78"
|
||||
rem split on : and get 2nd token
|
||||
for /f delims^=^:^ tokens^=2 %%b in ('echo %%a') do (
|
||||
rem we have " 192.168.42.78"
|
||||
rem split on . and get 4 tokens (octets)
|
||||
for /f "tokens=1-4 delims=." %%c in ("%%b") do (
|
||||
set _o1=%%c
|
||||
set _o2=%%d
|
||||
set _o3=%%e
|
||||
set _o4=%%f
|
||||
rem strip leading space from first octet
|
||||
set _3octet=!_o1:~1!.!_o2!.!_o3!.
|
||||
echo !_3octet!
|
||||
)
|
||||
)
|
||||
)
|
||||
rem add additional commands here
|
||||
endlocal
|
Reference in New Issue
Block a user