[ale] multiple program launches with Evolution

Michael B. Trausch fd0man at gmail.com
Thu Jan 25 10:14:43 EST 2007


On Wed, 2007-01-24 at 23:08 -0500, James Sumners wrote:

> Write a script that checks for a running pid and goes from there.


Here is a very simple one that will do the job, at least on my system:

#!/bin/sh
#
# Evolution startup script.
#

EV_PROCESS="evolution --component=mail"
EV_PID_LIST=`ps ax -o pid,command | grep "$EV_PROCESS" | grep -v grep`

if [ "${EV_PID_LIST}" = "" ]; then
    exec /usr/bin/evolution
else
    EV_PID=$(echo $EV_PID_LIST | cut -f 1 -d' ')
    printf "You already have Evolution running (pid %d)!\n" "${EV_PID}"
    exit 1
fi

    -- Mike

--
Michael B. Trausch
                    fd0man at gmail.com
Phone: (404) 592-5746
                          Jabber IM:
                    fd0man at gmail.com
              fd0man at livejournal.com
Demand Freedom!  Use open and free protocols, standards, and software!
-------------- next part --------------
An HTML attachment was scrubbed...

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part




More information about the Ale mailing list