#!/bin/sh ## # Start Retroclient (pitond) daemon # # please make sure this is saved with unix line endings ## . /etc/rc.common StartService () { ConsoleMessage "RetroClient StartService called" echo "RetroClient StartService called" RetroConfig="/Library/Preferences/retroclient.state" if [ -f "$RetroConfig" ] && [ -d "/Applications/Retrospect Client.app" ]; then ConsoleMessage "Starting Retrospect Client" echo "Starting Retrospect Client" /Applications/Retrospect\ Client.app/Contents/Resources/pitond & echo $! > "/var/run/RetroClient" else ConsoleMessage "error on either $RetroConfig or /Applications/Retrospect Client.app" echo "error on either $RetroConfig or /Applications/Retrospect Client.app" fi } StopService () { ConsoleMessage "RetroClient StopService called" echo "RetroClient StopService called" if pid=$(GetPID RetroClient); then ConsoleMessage "Stopping Retrospect Client (${pid})" echo "Stopping Retrospect Client (${pid})" kill -TERM "${pid}" else ConsoleMessage "Retrospect Client is not running." echo "Retrospect Client is not running." fi } RestartService () { ConsoleMessage "RetroClient RestartService called" echo "RetroClient RestartService called" StopService StartService } RunService "$1"