diff options
| author | root <root@overo.(none)> | 2012-06-07 11:31:08 +0100 |
|---|---|---|
| committer | root <root@overo.(none)> | 2012-06-07 11:31:08 +0100 |
| commit | 28f2d7aac92865b1f4dd8562d77893dee6101b49 (patch) | |
| tree | 827999b9112a3285898db8b838ce612164eb40c5 | |
| parent | fda5aaea51f2d6b3a0c07effa2c451b28aa0a6e5 (diff) | |
new startup script
| -rwxr-xr-x | puredata | 75 |
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 $? |
