diff --git a/AUTHORS b/AUTHORS index 9507963b..8f845076 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,7 @@ Contributors: Jakub Steiner Lapo Calamandrei Łukasz Jernaś + Michael Monreal Oleg Khlystov Philipp Gildein Ruben Vermeersch diff --git a/SparkleShare/sparkleshare.in b/SparkleShare/sparkleshare.in index 6a5e559d..ea373c17 100644 --- a/SparkleShare/sparkleshare.in +++ b/SparkleShare/sparkleshare.in @@ -27,11 +27,17 @@ case $1 in ;; stop) - 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." + if [ -e "${pidfile}" ]; then + sparklepid=`cat ${pidfile}` + if [ -n "`ps -p ${sparklepid} | grep ${sparklepid}`" ]; then + echo -n "Stopping SparkleShare..." + kill ${sparklepid} + rm -f ${pidfile} + echo " Done." + else + echo "SparkleShare isn't running, removing stale pid file" + rm -f ${pidfile} + fi else echo "SparkleShare isn't running." fi @@ -67,4 +73,5 @@ case $1 in *) echo "Usage: sparkleshare {start|stop|restart|help}" ;; + esac