diff options
author | Li xin <lixin.fnst@cn.fujitsu.com> | 2015-01-21 18:19:14 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-01-28 09:52:51 +0100 |
commit | ce7f238f684ffe0929d8d1629208c2afd818dd65 (patch) | |
tree | c83576734148cef54f9d3775101bd99bce178a8f /meta-oe/recipes-support/openct/openct/openct.init | |
parent | c8f98b15d0a06938e36de91ebf8b2471e50d21d8 (diff) | |
download | meta-openembedded-contrib-ce7f238f684ffe0929d8d1629208c2afd818dd65.tar.gz |
openct: add new recipe
OpenCT implements drivers for several smart card readers.
It comes as driver in ifdhandler format for PC/SC-Lite,
as CT-API driver, or as a small and lean middleware,
so applications can use it with minimal overhead.
OpenCT also has a primitive mechanism to export smart card
readers to remote machines via TCP/IP.
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/openct/openct/openct.init')
-rw-r--r-- | meta-oe/recipes-support/openct/openct/openct.init | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/openct/openct/openct.init b/meta-oe/recipes-support/openct/openct/openct.init new file mode 100644 index 0000000000..c6896095e3 --- /dev/null +++ b/meta-oe/recipes-support/openct/openct/openct.init @@ -0,0 +1,89 @@ +#!/bin/sh +# +# openct This shell script takes care of starting and stopping OpenCT. +# +# chkconfig: 2345 24 89 +# description: OpenCT is a middleware framework for smart card terminals. +# +# processname: ifdhandler +# config: /etc/openct.conf + +### BEGIN INIT INFO +# Provides: openct +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Should-Start: $syslog $network +# Should-Stop: $syslog $network +# Short-Description: Middleware framework for smart card terminals +# Description: This starts/stops the OpenCT middleware framework support +# for smart card terminals. +### END INIT INFO + +. /etc/init.d/functions + +exec="/usr/sbin/openct-control" +prog=openct +proc=ifdhandler + +OPENCT_OPTIONS= +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog + +start() { + retval=0 + if ! status $proc >/dev/null 2>&1 ; then + action $"Initializing OpenCT smart card terminals: " \ + $exec $OPENCT_OPTIONS init + retval=$? + [ $retval -eq 0 ] && touch $lockfile + fi + return $retval +} + +stop() { + if status $proc >/dev/null 2>&1 ; then + action $"Stopping OpenCT smart card terminals: " \ + $exec $OPENCT_OPTIONS shutdown + fi + retval=$? + if [ $retval -eq 0 ] ; then + rm -f /var/run/openct/status + rm -f $lockfile + fi + return $retval +} + +restart() { + stop + start +} + +oct_status() { + status $proc + retval=$? + if [ -e /var/run/openct/status ] ; then + $exec $OPENCT_OPTIONS status + [ -e /var/run/openct/status ] && \ + echo $"Waiting for reader attach/detach events..." + fi + return $retval +} + +case "$1" in + start|stop|restart) + $1 + ;; + reload|force-reload) + restart + ;; + status) + oct_status + ;; + try-restart|condrestart) + [ ! -f $lockfile ] || restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}" + exit 2 +esac |