#!/bin/sh # # SCM Microsystems SCR24x series # # Initialize or shutdown a PCMCIA SCR24x smartcardreader device # # The first argument should be either 'start' or 'stop'. The second # argument is the base name for the device. # # if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi # Get device attributes get_info $DEVICE case "$ACTION" in 'start') rm -f /dev/${DEVICE} major=`grep SCR24x /proc/devices | cut -c1-3` mknod /dev/$DEVICE c $major 0 chmod 664 /dev/$DEVICE /sbin/service pcscd status | grep -q running RETVAL=$? if [ $RETVAL -eq 0 ]; then /sbin/service pcscd stop /sbin/service pcscd start fi ;; 'check') fuser -k -s /dev/$DEVICE && exit 1 ;; 'stop') /sbin/service pcscd status | grep -q running RETVAL=$? if [ $RETVAL -eq 0 ]; then /sbin/service pcscd stop rmmod SCR24x fi rm -f /dev/$DEVICE if [ $RETVAL -eq 0 ]; then /sbin/service pcscd start fi ;; 'suspend') cardctl suspend ;; 'resume') cardctl resume ;; *) usage ;; esac exit 0