summaryrefslogtreecommitdiff
blob: 7e7c0509ae932a487d117e563b64c733a5d81e7f (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
#!/sbin/runscript

depend() {
	need modules
}

checkconfig() {
	if [ ! -d /etc/hotplug ]
	then
		eerror "USB Hotplug requires scripts & configs in /etc/hotplug !"
		return 1
	fi
}

start() {
	local error
	checkconfig || return 1
	ebegin "Starting USB Hotplug "
	for RC in /etc/hotplug/*.rc
	do
		$RC start
		error=$?
		if [ error ]
		then
			eend ${error} "hotplug script $RC failed at start "
			return 1
		fi
	done
	touch /var/lock/subsys/hotplug
	eend
}

stop() {
	local error
	checkconfig || return 1
	ebegin "Stopping USB Hotplug "
	for RC in /etc/hotplug/*.rc
	do
		$RC stop
		error=$?
		if [ error ]
		then
			eend ${error} "hot plug script $RC failed at stop "	
			return 1					
		fi
	done
	rm -f /var/lock/subsys/hotplug
	eend
}