summaryrefslogtreecommitdiffstats
path: root/base/aaabasicfs/network
blob: ff268b03b2f366e23e3dda17cb4b9de1b83294ac (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
# Begin $rc_base/init.d/network

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by thierryn1@hispeed.ch

. /etc/sysconfig/rc
. $rc_functions
let TIME=30
case "$1" in
	start)
		if [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then
			boot_mesg "Starting the wicd Daemon..."
			loadproc /usr/share/wicd/daemon/wicd-daemon.py
				if grep -v ^# /etc/fstab | grep _netdev > /dev/null; then
					while ! grep "nameserver" /etc/resolv.conf ; 
						do 
							sleep 1
							echo -n .
							let TIME=$TIME-1
							if [ $TIME -lt 1 ]; then
								boot_mesg "Time out"
								echo_failure
								exit 1
							fi
						done
					boot_mesg "Network successfully configured..."
					echo_ok
				fi
		
		else 
			if  [ -f /etc/rc.d/init.d/iplink ]; then
				/etc/rc.d/init.d/iplink start
			fi
		fi
		;;

	stop)
		if [ -f /usr/share/wicd/daemon/wicd-daemon.py ]; then
				boot_mesg "Stopping the wicd Daemon..."
				loadproc /usr/share/wicd/daemon/wicd-daemon.py --kill
		else
			if  [ -f /etc/rc.d/init.d/iplink ]; then
                                /etc/rc.d/init.d/iplink stop
                        fi
		fi
		;;

	*)
		echo "Usage: $0 {start|stop}"
		exit 1
		;;
esac

# End $rc_base/init.d/network