2010-04-27 17:19:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2010-04-27 22:37:29 +00:00
|
|
|
# Create a directory to save the pid to
|
|
|
|
mkdir -p /tmp/sparklepony/
|
|
|
|
|
2010-04-27 17:19:36 +00:00
|
|
|
if [[ "$1" == "start" ]]; then
|
2010-04-27 22:37:29 +00:00
|
|
|
if [ -e "/tmp/sparklepony/sparklepony.pid" ]; then
|
|
|
|
echo "SparklePony is already running."
|
|
|
|
else
|
|
|
|
echo -n "Starting SparklePony..."
|
|
|
|
|
|
|
|
# Start SparklePony in the background and save the pid
|
2010-04-27 22:46:38 +00:00
|
|
|
mono /usr/local/share/sparklepony/SparklePony.exe $2 &
|
2010-04-27 22:37:29 +00:00
|
|
|
PID=$!
|
|
|
|
echo $PID > /tmp/sparklepony/sparklepony.pid
|
|
|
|
echo " Done."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$1" == "stop" ]]; then
|
|
|
|
if [ -e "/tmp/sparklepony/sparklepony.pid" ]; then
|
|
|
|
echo -n "Stopping SparklePony..."
|
|
|
|
kill `cat /tmp/sparklepony/sparklepony.pid`
|
|
|
|
rm -f /tmp/sparklepony/sparklepony.pid
|
2010-04-27 23:02:44 +00:00
|
|
|
echo "Done."
|
2010-04-27 17:19:36 +00:00
|
|
|
else
|
2010-04-27 22:37:29 +00:00
|
|
|
echo "SparklePony isn't running."
|
2010-04-27 17:19:36 +00:00
|
|
|
fi
|
|
|
|
fi
|
2010-04-27 22:46:38 +00:00
|
|
|
|
|
|
|
if [[ "$1" == "--help" ]]; then
|
|
|
|
mono /usr/local/share/sparklepony/SparklePony.exe --help
|
|
|
|
fi
|