X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsynfigstudio-cph-monitor;h=6dcc2bc12f7d9e37dd906a7c21c5e82aba4de307;hb=510db4e9760325e1cf103a936fe04e10f17d0ccb;hp=7ca84610ccd865256e30e1bc50e726aa143f722b;hpb=f0b3a083d6ebf2080c85696b2867f019d9a97fa9;p=synfig.git 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`