summaryrefslogtreecommitdiff
path: root/puredata
diff options
context:
space:
mode:
Diffstat (limited to 'puredata')
-rwxr-xr-xpuredata75
1 files changed, 75 insertions, 0 deletions
diff --git a/puredata b/puredata
new file mode 100755
index 0000000..ff61f20
--- /dev/null
+++ b/puredata
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Start/stop PureData start-up file
+#
+# Tarim - June 2009
+#
+# puredata starts the startup file if it exists
+# puredata stop - stops ALL pd processes from running
+# puredata status - reports running if ANY pd processes are found
+
+PureData="pd"
+StartUp="/root/startup.pd"
+
+running() {
+ pidof "${PureData}" >/dev/null
+}
+
+start() {
+ if running; then
+ echo "${PureData} already running." 1>&2
+ return 1
+ else
+ [ -f "${StartUp}" ] && {
+ echo "Starting ${StartUp}..." 1>&2
+ cd /root
+ aoss "$PureData" -nogui -nomidi -r 22050 -open "${StartUp}" -path /root/theground/traktools/rj -path /root/theground/traktools/WorldQuantizer.rj -path /root/theground/traktools/listtools &
+# 1>/dev/null 2>/dev/null &
+ cd wim
+ ./wim.py genttest.xml -D
+ }
+ return 0
+ fi
+}
+
+stop() {
+ killall -SIGINT wim.py
+ sleep 1
+ killall -SIGTERM wim.py 2>/dev/null
+ echo "Stopping ${PureData}..." 1>&2
+ killall -SIGINT "${PureData}"
+ sleep 1
+ killall -SIGTERM "${PureData}" 2>/dev/null
+ return 0
+}
+
+case "$1" in
+start)
+ start
+ ;;
+
+stop)
+ stop
+ ;;
+
+restart)
+ stop
+ start
+ ;;
+
+status)
+ if running; then
+ echo "${PureData} running."
+ exit 0
+ else
+ echo "${PureData} not running."
+ exit 1
+ fi
+ ;;
+
+*)
+ echo "Usage: $0 {start | stop | restart | status}" 1>&2
+ exit 2
+esac
+
+exit $?