blob: 6b240ab82db3adf358f63b8a7190869b8f8983cd [file] [log] [blame]
#!/bin/sh
# vim: syntax=sh
#
# pcmcia.rc recover lost boot-time pcmcia_socket hotplug events
#
# $Id: $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#DEBUG=yes; export DEBUG
cd /etc/hotplug
. ./hotplug.functions
pcmcia_boot_events ()
{
if [ -d /sys/bus/pcmcia/devices/ ]; then
# 2.6 kernels
cd /sys/bus/pcmcia/devices/
for PCMCIA_DEVICE in *; do
if [ $PCMCIA_DEVICE == \* ]; then
continue;
fi;
MODALIAS=$(cat $PCMCIA_DEVICE/modalias)
debug_mesg $MODALIAS $PCMCIA_DEVICE
if [ -z $MODALIAS ]; then
continue;
fi;
ACTION=add
export MODALIAS ACTION
/sbin/hotplug pcmcia
done;
fi;
return 0
}
# See how we were called.
case "$1" in
start)
pcmcia_boot_events
;;
stop)
# echo $"pcmcia stop -- ignored"
;;
restart)
# always invoke by absolute path, else PATH=$PATH:
$0 stop && $0 start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac