diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /vo/java/app.topcat | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'vo/java/app.topcat')
-rwxr-xr-x | vo/java/app.topcat | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vo/java/app.topcat b/vo/java/app.topcat new file mode 100755 index 00000000..e69f9134 --- /dev/null +++ b/vo/java/app.topcat @@ -0,0 +1,46 @@ +#!/bin/csh -fx + +unalias ps egrep java + +set dir = `dirname $0` +set me = `whoami` +set pid = `ps -fwu $me | egrep -i topcat | egrep -i Driver` # MACHDEP +set npid = $#pid +if ($npid == 0) then + # No TOPCAT running, check for a JSAMP/Aladin Hub. + set pid = `ps -fwu $me | egrep -i hub | egrep -i "jsamp|aladin"` + set npid = $#pid + set is_topcat = 0 +else + set is_topcat = 1 +endif + +set jar = topcat-full.jar + + +if ($#argv > 0) then + if ("$1" == "-bg") then + if ($npid == 0 && $is_topcat == 0) then + # No Hub running that we know about, clear out dreg .samp file. + /bin/rm -rf ~/.samp + endif + exec ${dir}/topcat & + + else if ("$1" == "-kill") then + kill -9 $pid[2] + + else if ("$1" == "-status") then + if ($npid == 0 && $is_topcat == 0) then + echo "off" + else + echo "on" + endif + + endif +else + if ($npid == 0 && $is_topcat == 0) then + # No Hub running that we know about, clear out dreg .samp file. + /bin/rm -rf ~/.samp + endif + exec ${dir}/topcat +endif |