OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [find-linuxes.sh] - Blame information for rev 564

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 548 jeremybenn
#!/bin/bash
2
 
3
# Copyright (C) 2011 Embecosm Limited
4
 
5
# Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
6
 
7
# This file is a script to start up a group of Linux instances
8
 
9
# This program is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by the Free
11
# Software Foundation; either version 3 of the License, or (at your option)
12
# any later version.
13
 
14
# This program is distributed in the hope that it will be useful, but WITHOUT
15
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
17
# more details.
18
 
19
# You should have received a copy of the GNU General Public License along
20
# with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 
22
# ------------------------------------------------------------------------------
23
 
24
# IP list excluding all known IPs
25 553 jeremybenn
ip_list="192.168.0.2-39,41-59,61-79,82-127,129,130,133-255"
26 548 jeremybenn
ip_file=`dirname ${DEJAGNU}`/ip-avail.txt
27
 
28
# Keep using nmap until we get the same number of IP addresses twice running.
29
nmap -sP -n ${ip_list} | \
30
    sed -n -e 's/Nmap scan report for //p' | \
31
    sort > ${ip_file}
32
len1=`wc -l ${ip_file} | cut -d " " -f 1`
33
nmap -sP -n ${ip_list} | \
34
    sed -n -e 's/Nmap scan report for //p' | \
35
    sort > ${ip_file}
36
len2=`wc -l ${ip_file} | cut -d " " -f 1`
37
 
38
while [ ${len1} -ne ${len2} ]
39
do
40
    len1=${len2}
41
    nmap -sP -n ${ip_list} | \
42
        sed -n -e 's/Nmap scan report for //p' | \
43
        sort > ${ip_file}
44
    len2=`wc -l ${ip_file} | cut -d " " -f 1`
45
done
46
 
47
# Print the results
48
cat ${ip_file}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.