Re: Script helped needed to kill one app then launch another
Something like this might get you there. Debugging needed:
APPCHK=$(ps aux | grep -c $PROGRAM1)
if [ $APPCHK = '0' ];
Echo "Nothing running, starting $PROGRAM1"
if [ $APPCHK = '$PROGRAM1' ];
Echo "Killing $PROGRAM1 and starting $PROGRAM2"
if [ $APPCHK = '$PROGRAM2' ];
Echo "Killing $PROGRAM2 and starting $PROGRAM1"
Last edited by toupeiro; September 11th, 2011 at 07:37 AM.
"Its easy to come up with new ideas, the hard part is letting go of what worked for you two years ago, but will soon be out of date." -Roger von Oech