allow to start/stop with the wrapper script
This commit is contained in:
parent
7c56adba62
commit
a06a68c876
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue