#!/bin/sh
#
# coldplug.service - hotplug(8) service file
#

case $1 in
start)
	# Notify the user if hotplug support is missing from their kernel.
	if [ ! -f /proc/sys/kernel/hotplug ]; then
		echo "CONFIG_HOTPLUG (hotplug support) is missing from your kernel!"
		exit 1
	fi
	# Check for hotplug package
	if [ ! -d /etc/hotplug ]; then
		echo "Coldplug requires hotplug!"
		exit 1
	fi
	# Do the deed
	for i in /etc/hotplug/*.rc; do
		$i start
	done
	;;
stop)
	;;
*)
	echo "usage: $0 start|stop"
esac

# EOF
