IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 14, 2005, 8:18:09 AM (21 years ago)
Author:
eugene
Message:

updating user commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/controller_check.c

    r4539 r4552  
    11# include "scheduler.h"
    22
    3 int controller_host (int argc, char **argv) {
     3int controller_check (int argc, char **argv) {
    44
    55  int status;
     
    77  IOBuffer buffer;
    88
    9   if (argc != 3) {
    10     fprintf (stderr, "USAGE: controller host (hostname)\n");
    11     return (FALSE);
     9  if (argc != 3) goto usage;
     10  if (strcasecmp (argv[2], "JOB") &&
     11      strcasecmp (argv[2], "HOST")) goto usage;
     12
     13  /* check if controller is running */
     14  status = CheckControllerStatus ();
     15  if (!status) {
     16    fprintf (stderr, "controller is not running\n");
     17    return (TRUE);
    1218  }
    1319
    14   /* start controller connection (if needed) */
    15   StartController ();
    16 
    17   sprintf (command, "host %s", argv[2]);
     20  sprintf (command, "check %s %s", argv[2], argv[3]);
    1821  InitIOBuffer (&buffer, 0x100);
    1922  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
     
    3235    case CONTROLLER_GOOD:
    3336      fprintf (stderr, "controller command sent\n"); 
     37      fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);
    3438      return (TRUE);
    3539
     
    4145  fprintf (stderr, "programming error: should not reach here\n"); 
    4246  exit (1);
     47
     48usage:
     49  fprintf (stderr, "USAGE: controller check job (jobID)\n");
     50  fprintf (stderr, "USAGE: controller check host (hostID)\n");
     51  return (FALSE);
    4352}
Note: See TracChangeset for help on using the changeset viewer.