|
-
- ipPrefix='10.0.0';
- ipPrefixRegex = '10\.0\.0';
- if ispc()
- system(['for /L %a in (1,1,254) do @start /b ping ' ipPrefix '.%a -w 100 -n 2 >nul']);
- [~,arptable] = system('arp -a');
- ipaddresses = regexp(arptable,[ipPrefixRegex '\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])(?=[-a-f0-9\s]*?dynamic)'],'match');
- elseif isunix()
- [~,ipaddresses] = system(['echo $(seq 254) | xargs -P255 -I% -d" " ping -W 1 -c 1 ' ipPrefix '.% | grep -P -o "[0-1].*?(?=:)"']);
- elseif ismac()
- [~,ipaddresses] = system(['seq 254 | xargs -n1 -P255 -I% -- sh -c "ping -W1 -c1 ' ipPrefix '.% &>/dev/null && echo ' ipPrefix '.%"']);
- else
-
- end
-
-
- %% find prologix
|