summaryrefslogtreecommitdiffstats
path: root/abs/extra/foldingathome/foldingathome-v7.rc.d
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-12-04 21:43:33 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-12-04 21:43:33 (GMT)
commit03a4f6f5c9a43baf1dd7d5e9b44e5113b90ba35b (patch)
tree5d7dd7d95011fda5712356e67792d4d89b3d3f1f /abs/extra/foldingathome/foldingathome-v7.rc.d
parent251aa67903af196b8cfe6eac0ff04a37a456238d (diff)
downloadlinhes_pkgbuild-03a4f6f5c9a43baf1dd7d5e9b44e5113b90ba35b.zip
linhes_pkgbuild-03a4f6f5c9a43baf1dd7d5e9b44e5113b90ba35b.tar.gz
linhes_pkgbuild-03a4f6f5c9a43baf1dd7d5e9b44e5113b90ba35b.tar.bz2
foldingathome: updated client to v7
refs #872
Diffstat (limited to 'abs/extra/foldingathome/foldingathome-v7.rc.d')
-rw-r--r--abs/extra/foldingathome/foldingathome-v7.rc.d46
1 files changed, 46 insertions, 0 deletions
diff --git a/abs/extra/foldingathome/foldingathome-v7.rc.d b/abs/extra/foldingathome/foldingathome-v7.rc.d
new file mode 100644
index 0000000..91a395a
--- /dev/null
+++ b/abs/extra/foldingathome/foldingathome-v7.rc.d
@@ -0,0 +1,46 @@
+#!/bin/bash
+#/etc/rc.d/foldingathome-v7
+#
+# Starts the Folding@Home-v7 client in the background
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON=foldingathome-v7
+#ARGS=
+
+#[ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
+
+PID=$(pidof -x -o %PPID /opt/fah-v7/FAHClient)
+case "${1}" in
+ start)
+ stat_busy "Starting $DAEMON"
+ [ -z "${PID}" ] && /opt/fah-v7/FAHClient --config /opt/fah-v7/config.xml --exec-directory=/opt/fah-v7 --data-directory=/opt/fah-v7 &> /dev/null &
+ add_daemon $DAEMON
+ if [ ! -z "$PID" -o $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ stat_done
+ exit 1
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping $DAEMON"
+ [ ! -z "${PID}" ] && kill ${PID} &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon $DAEMON
+ stat_done
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac