Module: synfig
Branch: genete_master
Commit: 510db4e9760325e1cf103a936fe04e10f17d0ccb
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=510db4e9760325e1cf103a936fe04e10f17d0ccb

Author: Konstantin Dmitriev <ksee.zelga...@gmail.com>
Date:   Mon Jul 27 18:56:41 2009 +0700

synfigstudio-cph-monitor: Better detection for running synfigstudio.

---

 synfig-studio/trunk/synfigstudio-cph-monitor |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/synfig-studio/trunk/synfigstudio-cph-monitor 
b/synfig-studio/trunk/synfigstudio-cph-monitor
index 7ca8461..6dcc2bc 100755
--- a/synfig-studio/trunk/synfigstudio-cph-monitor
+++ b/synfig-studio/trunk/synfigstudio-cph-monitor
@@ -118,18 +118,13 @@ dumpstats()
 mainloop()
 {
        while true; do
-               export PS=$(ps -f -u `whoami`)
-               if ( ( echo "$PS" |egrep "synfigstudio$" >/dev/null ) || ( echo 
"$PS" | egrep "synfigstudio " >/dev/null ) ) ; then
+               if ( ps --no-headers -f -Csynfigstudio |egrep "^`whoami`" > 
/dev/null ) ; then
                        #synfigstudio process exist
                        if [[ $STARTED == 0 ]]; then
                                STARTED=1
                                RUNTIME=0
                                #get version
-                               if ( echo "$PS" |egrep "synfigstudio$" 
>/dev/null ) ; then
-                                       P=$( echo "$PS" |egrep "synfigstudio$"| 
tr -s ' '| cut -d ' ' -f 8)
-                               else
-                                       P=$( echo "$PS" |egrep "synfigstudio "| 
tr -s ' '| cut -d ' ' -f 8)
-                               fi
+                               P=$(ps --no-headers -f -Csynfigstudio |egrep 
"^`whoami`" | tr -s ' '| cut -d ' ' -f 8)
                                echo 
                                if [ ! -e $P ]; then
                                        P=`which $P`


------------------------------------------------------------------------------
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to