summarylogtreecommitdiffstats
path: root/plptools.rcd
diff options
context:
space:
mode:
authorMarkus Heidelberg2012-01-08 21:33:00 +0100
committerMarkus Heidelberg2015-06-27 01:39:46 +0200
commit5f5f45251ae9f1832eaae35e85c4a668ce791384 (patch)
treecbe9205e705bba39e5126d5b738a4322ba61c561 /plptools.rcd
parent1967c544626679747b1cf895820419b746466185 (diff)
downloadaur-5f5f45251ae9f1832eaae35e85c4a668ce791384.tar.gz
plptools 1.0.11-2: fix the package
Make it build and run properly. Successfully tested with a connection to a Psion Series 5MX. ** Manually imported from AUR 3 **
Diffstat (limited to 'plptools.rcd')
-rwxr-xr-xplptools.rcd152
1 files changed, 152 insertions, 0 deletions
diff --git a/plptools.rcd b/plptools.rcd
new file mode 100755
index 000000000000..1f9be6cc1557
--- /dev/null
+++ b/plptools.rcd
@@ -0,0 +1,152 @@
+#!/bin/bash
+#
+# plptools Starts ncpd/plpfuse.
+#
+# chkconfig: 2345 45 10
+# description: This facility enables connectivity to an EPOC PDA.
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/plptools
+
+NCPD_PIDFILE=/var/run/plptools/ncpd.pid
+NCPD_PID=$(cat $NCPD_PIDFILE 2>/dev/null)
+if ! readlink -q /proc/$NCPD_PID/exe | grep -q '^/usr/sbin/ncpd'; then
+ NCPD_PID=
+ rm $NCPD_PIDFILE 2>/dev/null
+fi
+
+PLPFUSE_PIDFILE=/var/run/plptools/plpfuse.pid
+PLPFUSE_PID=$(cat $PLPFUSE_PIDFILE 2>/dev/null)
+if ! readlink -q /proc/$PLPFUSE_PID/exe | grep -q '^/usr/sbin/plpfuse'; then
+ PLPFUSE_PID=
+ rm $PLPFUSE_PIDFILE 2>/dev/null
+fi
+
+PLPPRINTD_PIDFILE=/var/run/plptools/plpprintd.pid
+PLPPRINTD_PID=$(cat $PLPPRINTD_PIDFILE 2>/dev/null)
+if ! readlink -q /proc/$PLPPRINTD_PID/exe | grep -q '^/usr/sbin/plpprintd'; then
+ PLPPRINTD_PID=
+ rm $PLPPRINTD_PIDFILE 2>/dev/null
+fi
+
+start() {
+ echo "Starting EPOC support ..."
+ RETVAL=0
+ if [ ! -x /var/run/plptools ] ; then
+ install -m755 -d /var/run/plptools
+ fi
+ if test "$START_NCPD" = "yes" ; then
+ stat_busy " ncpd: "
+ [[ -z $NCPD_PID ]] && /usr/sbin/ncpd $NCPD_ARGS
+ if [[ $? -gt 0 ]]; then
+ RETVAL=1
+ stat_fail
+ else
+ PID=`pidof -o %PPID /usr/sbin/ncpd`
+ echo $PID > $NCPD_PIDFILE 2>/dev/null
+ add_daemon ncpd
+ stat_done
+ fi
+ fi
+ if [ $RETVAL -eq 0 ] ; then
+ if test "$START_PLPFUSE" = "yes" ; then
+ stat_busy " plpfuse: "
+ [[ -z $PLPFUSE_PID ]] && /usr/sbin/plpfuse $PLPFUSE_ARGS $PLPFUSE_MOUNTPOINT
+ if [[ $? -gt 0 ]]; then
+ RETVAL=1
+ stat_fail
+ else
+ PID=`pidof -o %PPID /usr/sbin/plpfuse`
+ echo $PID > $PLPFUSE_PIDFILE 2>/dev/null
+ add_daemon plpfuse
+ stat_done
+ fi
+ fi
+ fi
+ if [ $RETVAL -eq 0 ] ; then
+ if test "$START_PLPPRINTD" = "yes" ; then
+ stat_busy " plpprintd: "
+ [[ -z $PLPPRINTD_PID ]] && /usr/sbin/plpprintd $PLPPRINTD_ARGS
+ if [[ $? -gt 0 ]]; then
+ RETVAL=1
+ stat_fail
+ else
+ PID=`pidof -o %PPID /usr/sbin/plpprintd`
+ echo $PID > $PLPPRINTD_PIDFILE 2>/dev/null
+ add_daemon plpprintd
+ stat_done
+ fi
+ fi
+ fi
+ [ $RETVAL -eq 0 ] && touch /var/lock/plptools
+}
+
+stop() {
+ echo "Stopping EPOC support ..."
+ RETVAL=0
+ if test "$START_PLPPRINTD" = "yes" ; then
+ stat_busy " plpprintd: "
+ [[ ! -z $PLPPRINTD_PID ]] && kill $PLPPRINTD_PID &> /dev/null
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ else
+ rm $PLPPRINTD_PIDFILE &>/dev/null
+ rm_daemon plpprintd
+ stat_done
+ fi
+ fi
+ if test "$START_PLPFUSE" = "yes" ; then
+ stat_busy " plpfuse: "
+ [[ ! -z $PLPFUSE_PID ]] && fusermount -u $PLPFUSE_MOUNTPOINT &> /dev/null
+ if [[ $? -gt 0 ]]; then
+ stat_fail
+ else
+ rm $PLPFUSE_PIDFILE &>/dev/null
+ rm_daemon plpfuse
+ stat_done
+ fi
+ fi
+ if test "$START_NCPD" = "yes" ; then
+ stat_busy " ncpd: "
+ [[ ! -z $NCPD_PID ]] && kill $NCPD_PID &> /dev/null
+ if [[ $? -gt 0 ]]; then
+ RETVAL=1
+ stat_fail
+ else
+ rm $NCPD_PIDFILE &>/dev/null
+ rm_daemon ncpd
+ stat_done
+ fi
+ echo
+ fi
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/plptools
+}
+
+restart() {
+ stop
+ start
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status ncpd
+ status plpprintd
+ ;;
+ restart|reload)
+ restart
+ ;;
+ condrestart)
+ test -f /var/lock/plptools && restart || :
+ ;;
+ *)
+ echo "Usage: plptools {start|stop|status|restart|reload|condrestart}"
+esac
+exit 0