updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / opencryptoki / pkcsslotd
blob1f67441c72a448a628ec43dc1d7bf1331f06d65a
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON='pkcsslotd'
7 CONFSTART=/usr/sbin/pkcs11_startup
8 SLOTDBIN=/usr/sbin/pkcsslotd
9 PID=`pidof -o %PPID ${SLOTDBIN}`
11 case "$1" in
13 start)
14 stat_busy "Starting ${DAEMON}"
15 if [ -z "$PID" ]; then
16 $CONFSTART
17 $SLOTDBIN
19 if [ ! -z "$PID" -o $? -gt 0 ]; then
20 stat_fail
21 else
22 add_daemon ${DAEMON}
23 stat_done
27 stop)
28 stat_busy "Stopping ${DAEMON}"
29 [ ! -z "$PID" ] && kill $PID &> /dev/null
30 if [ $? -gt 0 ]; then
31 stat_fail
32 else
33 rm_daemon ${DAEMON}
34 stat_done
38 restart)
39 $0 stop
40 $0 start
44 echo "usage: $0 {start|stop|restart}"
46 esac
47 exit 0