aboutsummaryrefslogtreecommitdiff
path: root/vo/votools/topcat.cl
blob: a8192fb10ab5ec941b91fc9ea7decdace3a12598 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#{  TOPCAT -- Start or stop the TOPCAT app.

procedure topcat (cmd)

string	cmd			{ prompt = "Command"			}
bool	bkg     = yes		{ prompt = "Run in background?"		}
bool	verbose = no		{ prompt = "Print actions?"		}

begin
    string action, command, ch
    bool   verb


    if ($nargs > 0) 
      action   =  cmd
    else
      action   =  "start"
    verb       =  verbose
    command    =  "!" // osfn ("vo$java/app.topcat")


    if (action == "stop" || action == "off") {
        if (verb)
            printf ("Stopping Topcat .... ")
        command = command // " -kill"
        print (command) | cl(, >& "dev$null")


    } else if (action == "status") {
        command = command // " -status"
        print (command) | cl()

    } else {
	# Default is to start the app
        if (verb)
            printf ("Starting Topcat .... ")
        command = command // " -bg"
        print (command) | cl(, >& "dev$null")
    }

    if (verb)
	printf ("\n")
end