From: Konstantin Dmitriev Date: Sat, 25 Jul 2009 06:39:28 +0000 (+0700) Subject: synfigstudio-cph-monitor: Detect synfigstudio started with arguments too. X-Git-Url: https://git.pterodactylus.net/?p=synfig.git;a=commitdiff_plain;h=c7efa619796407db833eb61ac1f41deb4cca78c8 synfigstudio-cph-monitor: Detect synfigstudio started with arguments too. --- diff --git a/synfig-studio/trunk/synfigstudio-cph-monitor b/synfig-studio/trunk/synfigstudio-cph-monitor index 76f77f4..000b83a 100755 --- a/synfig-studio/trunk/synfigstudio-cph-monitor +++ b/synfig-studio/trunk/synfigstudio-cph-monitor @@ -98,13 +98,18 @@ dumpstats() mainloop() { while true; do - if ( ps -f -u `whoami`|egrep "synfigstudio$" >/dev/null ) ; then + export PS=$(ps -f -u `whoami`) + if ( ( echo "$PS" |egrep "synfigstudio$" >/dev/null ) || ( echo "$PS" | egrep "synfigstudio " >/dev/null ) ) ; then #synfigstudio process exist if [[ $STARTED == 0 ]]; then STARTED=1 RUNTIME=0 #get version - P=$(ps -f -u `whoami`|egrep "synfigstudio$"| tr -s ' '| cut -d ' ' -f 8) + 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 echo if [ ! -e $P ]; then P=`which $P`