File: ifconfigs

package info (click to toggle)
freeswan 2.04-11.3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 23,340 kB
  • ctags: 12,260
  • sloc: ansic: 72,499; sh: 14,497; asm: 3,312; perl: 3,153; xml: 2,961; makefile: 2,702; tcl: 620; exp: 612; pascal: 228; sed: 206; awk: 124; lisp: 3
file content (39 lines) | stat: -rwxr-xr-x 1,017 bytes parent folder | download | duplicates (5)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
# Set up or tear down virtual interfaces needed for testing.
# Only "check" can work without superuser privileges.

. CONFIG

for i
do
	case "$i" in
	up)
		/sbin/ifconfig $EASTIF $EASTIP netmask 255.255.255.255
		/sbin/ifconfig $WESTIF $WESTIP netmask 255.255.255.255
		/sbin/ifconfig $NORTHIF $NORTHIP netmask 255.255.255.255
		/sbin/ifconfig $SOUTHIF $SOUTHIP netmask 255.255.255.255
		;;
	down)
		/sbin/ifconfig $EASTIF down
		/sbin/ifconfig $WESTIF down
		/sbin/ifconfig $NORTHIF down
		/sbin/ifconfig $SOUTHIF down
		;;
	check)
		( /sbin/ifconfig $EASTIF | grep 'inet addr' >/dev/null ) &&
		( /sbin/ifconfig $WESTIF | grep 'inet addr' >/dev/null ) &&
		( /sbin/ifconfig $NORTHIF | grep 'inet addr' >/dev/null ) &&
		( /sbin/ifconfig $SOUTHIF | grep 'inet addr' >/dev/null )
		;;
	show)
		/sbin/ifconfig $EASTIF
		/sbin/ifconfig $WESTIF
		/sbin/ifconfig $NORTHIF
		/sbin/ifconfig $SOUTHIF
		;;
	*)
		echo "$0: \"up\", \"down\", \"check\", or \"show\" expected, not \"$i\"" >&2
		exit 1
		;;
	esac
done