3 # plptools Starts ncpd/plpfuse.
5 # chkconfig: 2345 45 10
6 # description: This facility enables connectivity to an EPOC PDA.
10 .
/etc
/conf.d
/plptools
12 NCPD_PIDFILE
=/var
/run
/plptools
/ncpd.pid
13 NCPD_PID
=$
(cat $NCPD_PIDFILE 2>/dev
/null
)
14 if ! readlink
-q /proc
/$NCPD_PID/exe |
grep -q '^/usr/sbin/ncpd'; then
16 rm $NCPD_PIDFILE 2>/dev
/null
19 PLPFUSE_PIDFILE
=/var
/run
/plptools
/plpfuse.pid
20 PLPFUSE_PID
=$
(cat $PLPFUSE_PIDFILE 2>/dev
/null
)
21 if ! readlink
-q /proc
/$PLPFUSE_PID/exe |
grep -q '^/usr/sbin/plpfuse'; then
23 rm $PLPFUSE_PIDFILE 2>/dev
/null
26 PLPPRINTD_PIDFILE
=/var
/run
/plptools
/plpprintd.pid
27 PLPPRINTD_PID
=$
(cat $PLPPRINTD_PIDFILE 2>/dev
/null
)
28 if ! readlink
-q /proc
/$PLPPRINTD_PID/exe |
grep -q '^/usr/sbin/plpprintd'; then
30 rm $PLPPRINTD_PIDFILE 2>/dev
/null
34 echo "Starting EPOC support ..."
36 if [ ! -x /var
/run
/plptools
] ; then
37 install -m755 -d /var
/run
/plptools
39 if test "$START_NCPD" = "yes" ; then
41 [[ -z $NCPD_PID ]] && /usr
/sbin
/ncpd
$NCPD_ARGS
42 if [[ $?
-gt 0 ]]; then
46 PID
=`pidof -o %PPID /usr/sbin/ncpd`
47 echo $PID > $NCPD_PIDFILE 2>/dev
/null
52 if [ $RETVAL -eq 0 ] ; then
53 if test "$START_PLPFUSE" = "yes" ; then
54 stat_busy
" plpfuse: "
55 [[ -z $PLPFUSE_PID ]] && /usr
/sbin
/plpfuse
$PLPFUSE_ARGS $PLPFUSE_MOUNTPOINT
56 if [[ $?
-gt 0 ]]; then
60 PID
=`pidof -o %PPID /usr/sbin/plpfuse`
61 echo $PID > $PLPFUSE_PIDFILE 2>/dev
/null
67 if [ $RETVAL -eq 0 ] ; then
68 if test "$START_PLPPRINTD" = "yes" ; then
69 stat_busy
" plpprintd: "
70 [[ -z $PLPPRINTD_PID ]] && /usr
/sbin
/plpprintd
$PLPPRINTD_ARGS
71 if [[ $?
-gt 0 ]]; then
75 PID
=`pidof -o %PPID /usr/sbin/plpprintd`
76 echo $PID > $PLPPRINTD_PIDFILE 2>/dev
/null
82 [ $RETVAL -eq 0 ] && touch /var
/lock
/plptools
86 echo "Stopping EPOC support ..."
88 if test "$START_PLPPRINTD" = "yes" ; then
89 stat_busy
" plpprintd: "
90 [[ ! -z $PLPPRINTD_PID ]] && kill $PLPPRINTD_PID &> /dev
/null
91 if [[ $?
-gt 0 ]]; then
94 rm $PLPPRINTD_PIDFILE &>/dev
/null
99 if test "$START_PLPFUSE" = "yes" ; then
100 stat_busy
" plpfuse: "
101 [[ ! -z $PLPFUSE_PID ]] && fusermount
-u $PLPFUSE_MOUNTPOINT &> /dev
/null
102 if [[ $?
-gt 0 ]]; then
105 rm $PLPFUSE_PIDFILE &>/dev
/null
110 if test "$START_NCPD" = "yes" ; then
112 [[ ! -z $NCPD_PID ]] && kill $NCPD_PID &> /dev
/null
113 if [[ $?
-gt 0 ]]; then
117 rm $NCPD_PIDFILE &>/dev
/null
123 [ $RETVAL -eq 0 ] && rm -f /var
/lock
/plptools
131 # See how we were called.
147 test -f /var
/lock
/plptools
&& restart ||
:
150 echo "Usage: plptools {start|stop|status|restart|reload|condrestart}"