bash script help
Noah John Gellner
noah.gellner-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Sun Jun 20 07:23:42 UTC 2004
I am using a script to preload openoffice so that it starts more
quickly. The script works very well except that when I exit X to get to
the console the script keeps running and outputting messages to the
display reporting that no display is found.
I am hoping that someone can tell me how to modify the script to test if
X is running, and if not to terminate the loop.
The script comes from the Gentoo forums and has two parts
Part one is called by Gnome Sessions:
## killing all traces of openoffice
killall -9 ooresident
killall -9 soffice.bin
## waiting for them to really dissapear (can even take a sec or 2
depending
## on the busy-ness and speed of your system)
sleep 1
## the actual keepalive is called in the bg
ooresident &
Part two, called oowresident, is obviously called by part one:
#!/bin/bash
killall -9 soffice.bin ## just in case....
i=0
while [ $i -eq 0 ]
echo $i
do
{
dummy=`ooffice -plugin -quickstart ;`
i=$?
echo $i
echo "OpenOffice was unloaded. Loading it again..."
}
done
Beside the problem with the script not terminating with X, it works
really well, shorting OO startup times to a few seconds.
Help is greatly appreciated.
Cheers,
Noah
--
Even Buddha punished evil - "Master Killer"
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list