allow to start/stop with the wrapper script

This commit is contained in:
Hylke Bons 2010-04-27 23:37:29 +01:00
parent 7c56adba62
commit a06a68c876

View file

@ -1,11 +1,29 @@
#!/bin/bash
# Create a directory to save the pid to
mkdir -p /tmp/sparklepony/
if [[ "$1" == "start" ]]; then
mono /usr/share/local/sparklepony/SparklePony.exe
else
if [[ "$1" == "stop" ]]; then
# Stop SparklePony.exe
if [ -e "/tmp/sparklepony/sparklepony.pid" ]; then
echo "SparklePony is already running."
else
# Usage
echo -n "Starting SparklePony..."
# Start SparklePony in the background and save the pid
mono /usr/local/share/sparklepony/SparklePony.exe &
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
echo " Done."
else
echo "SparklePony isn't running."
fi
fi