- Thread Author
- #1
Hi all!
i need, for improve a script, to get only a specific ipadress (i have multiple network connection).
This is the script, i pass the IP manually:
in cygwin the command is:
Thanks from my heart!
i need, for improve a script, to get only a specific ipadress (i have multiple network connection).
This is the script, i pass the IP manually:
Code:
echo off
echo ==================================
echo ==== CONFIGURAZIONE ===
echo ==================================
ipconfig|find "ipv4" /i
set /p IP=From what IP you want reach extinguisher application?
echo IP choised is %IP%
SET INDIRIZZI=(10.1.2.3 10.1.2.4 OTHER_IP)
FOR %%A IN %INDIRIZZI% DO (
REM ECHO %%A
ROUTE ADD %%A MASK 255.255.255.255 %IP% METRIC 2
)
cls
(((echo Done!) & echo Keep cmd with red background opened to show connections from sps subnet ) & echo.)|MSG *
color CF
netstat -ano 1 | findstr "10.15.*3389"
exit
in cygwin the command is:
Bash:
ipconfig | grep IPv4 | cut -d':' -f 2 | cut -d' ' -f 2 | grep 10.12.
Thanks from my heart!