File: discover

package info (click to toggle)
ibsim 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 480 kB
  • sloc: ansic: 7,907; sh: 200; makefile: 49
file content (25 lines) | stat: -rwxr-xr-x 518 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

set -e

EXAMPLES_DIR="/usr/share/doc/ibsim-utils/net-examples"
NET_MAP="$EXAMPLES_DIR/net.1"
NUM_EXPECTED=3

ibsim -s -n "$NET_MAP" &
PID=$!
sleep 1

if ! ps "$PID" >/dev/null; then
	echo >&2 "Error: ibsim failed to start"
	exit 10
fi

ibsim-run /usr/sbin/ibnetdiscover

NUM=`ibsim-run /usr/sbin/ibnetdiscover -l 2>/dev/null | wc -l`
if [ "$NUM" != "$NUM_EXPECTED" ]; then
	echo >&2 "Error: ibnetdiscover does not seem to see the network. Lines seen: $NUM, expected: $NUM_EXPECTED."
	exit 20
fi
kill "$PID"