SparkleShare/sparkleshare

58 lines
1.4 KiB
Plaintext
Raw Normal View History

2010-04-27 17:19:36 +00:00
#!/bin/bash
# Create a directory to save the pid to
2010-05-03 00:14:27 +00:00
mkdir -p /tmp/sparkleshare/
2010-04-27 17:19:36 +00:00
if [[ "$1" == "start" ]]; then
2010-05-03 00:14:27 +00:00
if [ -e "/tmp/sparkleshare/sparkleshare.pid" ]; then
echo "SparkleShare is already running."
else
2010-05-03 00:14:27 +00:00
echo -n "Starting SparkleShare..."
2010-05-03 00:14:27 +00:00
# Start SparkleShare in the background and save the pid
mono /usr/local/share/sparkleshare/SparkleShare.exe $2 &
PID=$!
2010-05-03 00:14:27 +00:00
echo $PID > /tmp/sparkleshare/sparkleshare.pid
echo " Done."
fi
fi
if [[ "$1" == "stop" ]]; then
2010-05-03 00:14:27 +00:00
if [ -e "/tmp/sparkleshare/sparkleshare.pid" ]; then
echo -n "Stopping SparkleShare..."
kill `cat /tmp/sparkleshare/sparkleshare.pid`
rm -f /tmp/sparkleshare/sparkleshare.pid
2010-04-28 00:07:43 +00:00
echo " Done."
2010-04-27 17:19:36 +00:00
else
2010-05-03 00:14:27 +00:00
echo "SparkleShare isn't running."
2010-04-27 17:19:36 +00:00
fi
fi
if [[ "$1" == "restart" ]]; then
2010-05-03 00:14:27 +00:00
if [ -e "/tmp/sparkleshare/sparkleshare.pid" ]; then
echo -n "Stopping SparkleShare..."
kill `cat /tmp/sparkleshare/sparkleshare.pid`
rm -f /tmp/sparkleshare/sparkleshare.pid
echo " Done."
else
2010-05-03 00:14:27 +00:00
echo "SparkleShare isn't running."
fi
2010-05-03 00:14:27 +00:00
if [ -e "/tmp/sparkleshare/sparkleshare.pid" ]; then
echo "SparkleShare is already running."
else
2010-05-03 00:14:27 +00:00
echo -n "Starting SparkleShare..."
2010-05-03 00:14:27 +00:00
# Start SparkleShare in the background and save the pid
mono /usr/local/share/sparkleshare/SparkleShare.exe $2 &
PID=$!
2010-05-03 00:14:27 +00:00
echo $PID > /tmp/sparkleshare/sparkleshare.pid
echo " Done."
fi
fi
if [[ "$1" == "--help" ]]; then
2010-05-03 00:14:27 +00:00
mono /usr/local/share/sparkleshare/SparkleShare.exe --help
fi