You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
2.1 KiB
85 lines
2.1 KiB
4 years ago
|
#!/bin/sh
|
||
|
#
|
||
|
# pcscd Starts the pcscd Daemon
|
||
|
#
|
||
|
# chkconfig: 2345 25 88
|
||
|
# description: The PC/SC smart card daemon is a resource manager for the \
|
||
|
# PC/SC lite and Musclecard frameworks. It coordinates \
|
||
|
# communications with smart card readers, smart cards, and \
|
||
|
# cryptographic tokens that are connected to the system.
|
||
|
#
|
||
|
# processname: pcscd
|
||
|
# config: @confdir@/reader.conf
|
||
|
#
|
||
|
### BEGIN INIT INFO
|
||
|
# Provides: pcscd
|
||
|
# Required-Start: $local_fs $remote_fs $syslog
|
||
|
# Required-Stop: $local_fs $remote_fs $syslog
|
||
|
# Should-Start: udev hal openct
|
||
|
# Should-Stop: udev hal openct
|
||
|
# Default-Start: 2 3 4 5
|
||
|
# Default-Stop: 0 1 6
|
||
|
# Short-Description: Daemon to access a smart card using PC/SC
|
||
|
# Description: The PC/SC smart card daemon is a resource manager for the
|
||
|
# PC/SC lite and Musclecard frameworks. It coordinates
|
||
|
# communications with smart card readers, smart cards, and
|
||
|
# cryptographic tokens that are connected to the system.
|
||
|
### END INIT INFO
|
||
|
#
|
||
|
# Note! pcscd should be started after pcmcia, and shut down before it
|
||
|
# for smooth experience with PCMCIA readers.
|
||
|
|
||
|
. @sysconfdir_exp@/init.d/functions
|
||
|
|
||
|
umask 077
|
||
|
|
||
|
exec=@sbindir_exp@/pcscd
|
||
|
prog=$(basename $exec)
|
||
|
lockfile=@localstatedir_exp@/lock/subsys/$prog
|
||
|
PCSCD_OPTIONS=
|
||
|
|
||
|
# Source config
|
||
|
if [ -f @sysconfdir_exp@/sysconfig/pcscd ] ; then
|
||
|
. @sysconfdir_exp@/sysconfig/pcscd
|
||
|
fi
|
||
|
|
||
|
start() {
|
||
|
echo -n $"Starting PC/SC smart card daemon ($prog): "
|
||
|
@sbindir_exp@/update-reader.conf && daemon $prog $PCSCD_OPTIONS
|
||
|
retval=$?
|
||
|
echo
|
||
|
[ $retval -eq 0 ] && touch $lockfile
|
||
|
return $retval
|
||
|
}
|
||
|
stop() {
|
||
|
echo -n $"Stopping PC/SC smart card daemon ($prog): "
|
||
|
killproc $prog
|
||
|
retval=$?
|
||
|
echo
|
||
|
[ $retval -eq 0 ] && rm -f $lockfile
|
||
|
return $retval
|
||
|
}
|
||
|
restart() {
|
||
|
stop
|
||
|
start
|
||
|
}
|
||
|
|
||
|
|
||
|
case "$1" in
|
||
|
start|stop|restart)
|
||
|
$1
|
||
|
;;
|
||
|
reload|force-reload)
|
||
|
restart
|
||
|
;;
|
||
|
status)
|
||
|
status $prog
|
||
|
;;
|
||
|
condrestart|try-restart)
|
||
|
[ ! -f $lockfile ] || restart
|
||
|
;;
|
||
|
*)
|
||
|
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
|
||
|
exit 2
|
||
|
esac
|