#!/bin/bash
#
# pcscd        Starts the pcscd Daemon
#
#
# chkconfig: 2345 12 88


. /etc/init.d/functions

[ -f /usr/local/sbin/pcscd ] || exit 0



# Source config
PATH=/sbin:/bin:/usr/local/sbin:/usr/bin:/usr/sbin
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib

umask 077

start() {
 	echo -n $"Starting smart card daemon: "
	pcscd $SYSLOGD_OPTIONS
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pcscd
	return $RETVAL
}	
stop() {
	echo -n $"Shutting down kernel logger: "
	killproc pcscd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pcscd
	return $RETVAL
}
rhstatus() {
	status pcscd
}
restart() {
	stop
	start
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  status)
  	rhstatus
	;;
  restart|reload)
  	restart
	;;
  condrestart)
  	[ -f /var/lock/subsys/pcscd ] && restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|condrestart}"
	exit 1
esac

exit $?

