File: network

package info (click to toggle)
usbmgr 0.4.8-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 344 kB
  • ctags: 318
  • sloc: ansic: 2,067; sh: 539; makefile: 198
file content (30 lines) | stat: -rw-r--r-- 477 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
#
# network setup script
#	Copyright (c) by Shuu Yamaguchi <shuu@wondernetworkresources.com>
#	Can be freely distributed and used under the terms of the GNU GPL.
#
# network
#

IFUP=/sbin/ifup
IFDOWN=/sbin/ifdown

DEV=`grep eth /proc/net/dev | cut -d : -f 1`
for dev in $DEV
do
	case $ACTION in
	add)
		ifconfig $dev | grep UP
		if [ $? != 0 ];then
			$IFUP $dev
		fi
		;;
	remove)
		ifconfig $dev | grep UP
		if [ $? = 0 ];then
			$IFDOWN $dev
		fi
		;;
	esac	
done