[Xastir] Strange question....
Jason Winningham
jdw at eng.uah.edu
Mon Mar 7 12:26:43 EST 2005
#!/bin/bash
# kill xastir
ps -ef | egrep "xastir" | grep -v grep | grep -v "$0" | awk
'{printf("kill %s\n",$2)}' | bash
sleep 3
ps -ef | egrep "xastir" | grep -v grep | grep -v "$0" | awk
'{printf("kill -9 %s\n",$2)}' | bash
nohup xastir&
Note: ps flags may differ from system to system; these suite solaris.
You'd need -auxw on Mac OS X, for example; maybe -aux for some linux
flavors.
If it gets noisy (too many emails from cron with the output of the
commands), add "exec >/dev/null 2>&1" after the second line.
You would probably want some sort of check to see if the user was
logged in, and probably other sanity checks. YMMV.
-Jason
kg4wsv
More information about the Xastir
mailing list