[cli] remove pid file when sparkleshare isn't running
This commit is contained in:
parent
43619354d3
commit
43be32cf52
1
AUTHORS
1
AUTHORS
|
@ -13,6 +13,7 @@ Contributors:
|
|||
Jakub Steiner <jimmac@novell.com>
|
||||
Lapo Calamandrei <calamandrei@gmail.com>
|
||||
Łukasz Jernaś <deejay1@srem.org>
|
||||
Michael Monreal <michael.monreal@gmail.com>
|
||||
Oleg Khlystov <pktfag@gmail.com>
|
||||
Philipp Gildein <rmbl@openspeak-project.org>
|
||||
Ruben Vermeersch <rubenv@gnome.org>
|
||||
|
|
|
@ -27,11 +27,17 @@ case $1 in
|
|||
;;
|
||||
|
||||
stop)
|
||||
if [ -e "/tmp/sparkleshare/sparkleshare.pid" ]; then
|
||||
if [ -e "${pidfile}" ]; then
|
||||
sparklepid=`cat ${pidfile}`
|
||||
if [ -n "`ps -p ${sparklepid} | grep ${sparklepid}`" ]; then
|
||||
echo -n "Stopping SparkleShare..."
|
||||
kill `cat /tmp/sparkleshare/sparkleshare.pid`
|
||||
rm -f /tmp/sparkleshare/sparkleshare.pid
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue