File: NetworkManager.in

package info (click to toggle)
network-manager 0.6.4-6%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 6,528 kB
  • ctags: 3,016
  • sloc: ansic: 33,692; sh: 9,574; makefile: 721
file content (55 lines) | stat: -rwxr-xr-x 1,078 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
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
#!/sbin/runscript
#
# NetworkManager:   NetworkManager daemon
#
# chkconfig: 345 98 02
# description:  This is a daemon for automatically switching network \
#               connections to the best available connection. \
#
# processname: NetworkManager
# pidfile: /var/run/NetworkManager.pid
#
### BEGIN INIT INFO
# Provides: $network
### END INIT INFO

prefix=@prefix@
exec_prefix=@prefix@
sbindir=@sbindir@

NETWORKMANAGER_BIN=${sbindir}/NetworkManager

# Sanity checks.
[ -x $NETWORKMANAGER_BIN ] || exit 0

# We need /sbin/ip
[ -x /sbin/ip ] || exit 0

# so we can rearrange this easily
processname=$NETWORKMANAGER_BIN
pidfile=/var/run/NetworkManager.pid

depend() {
	need hald
}

start()
{
	if [ -e ${pidfile} ]; then
		rm -f ${pidfile}
	fi
	ebegin "Starting NetworkManager"
	start-stop-daemon --start --quiet --exec ${processname}
	eend $?
	echo $(/bin/pidof NetworkManager) > ${pidfile}
}

stop()
{
	ebegin "Stopping NetworkManager"
	start-stop-daemon --stop --quiet --exec ${processname} --pidfile ${pidfile}
	eend $?
	if [ -e ${pidfile} ]; then
		rm -f $pidfile
	fi
}