aboutsummaryrefslogtreecommitdiff
path: root/vo/votools/aladin.cl
blob: 5b4299bc8d3b4bcaf2d5fa9fa1a1f1d22b31261e (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
#{  ALADIN -- Start or stop the ALADIN app.

procedure aladin (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.aladin")


    if (action == "stop" || action == "off") {
	if (verb)
	    printf ("Stopping Aladin .... ")
        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 Aladin .... ")
        command = command // " -bg"
        print (command) | cl(, >& "dev$null")
    }

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