home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 274.lha / NazCron_v1.0 / NC.rexx < prev    next >
OS/2 REXX Batch file  |  1989-08-06  |  2KB  |  80 lines

  1. /***********************/
  2. /* NC.rexx             */
  3. /* 7/20/89 - Don Nafis */
  4. /***********************/
  5.  
  6. /* This script will send the argument supplied by the user to
  7.    NazCron.  This must be a vaild NazCron ARexx command.  To
  8.    execute from a CLI, copy this script to your REXX: directory
  9.    and type:
  10.  
  11.      rx NC command [parm]
  12.      where command is any valid NazCron command.
  13.            [parm] is the parameter for commands which
  14.            require parameters.
  15.  
  16.    Examples:
  17.  
  18.      rx NC  list_events     ==> displays the names of all named events
  19.      rx NC  unlock_events   ==> tells NazCron to resume examining the
  20.                                 S:CRONTAB file
  21.  
  22.      rx NC  new_event_file ram:newcron
  23.                             ==> NazCron will stop processing events from
  24.                                 the old CRONTAB file and start processing
  25.                                 those from "ram:newcron"
  26.  
  27.      rx NC  shutdown        ==> terminates NazCron processing
  28.  
  29.      rx NC  add_event hithere * * * * * echo >ram:echo "hi there"
  30.                             ==> adds the event named "hithere" to the event
  31.                                 list.  This event will execute the echo
  32.                                 command each minute, putting the string
  33.                                 "hi there" in the file ram:echo.
  34.  */
  35.  
  36. /* Remove the comments below to trace this script. */
  37. /*--->trace results<---*/
  38.  
  39. options failat 20
  40. options results
  41.  
  42. arg doit
  43. if (doit == '') then
  44. do
  45.   say
  46.   say '  Usage:  rx NC  command [parm]'
  47.   say
  48.   exit 20
  49. end
  50.  
  51. say
  52.  
  53. address NAZCRON
  54. doit = upper(doit)
  55. doit
  56. if (rc ~= 0) then
  57.   say 'NazCron command: '||doit||' failed with return code: '||rc
  58. else
  59. do
  60.   say 'NazCron command: '||doit||' was successful'
  61.   eventlist = result
  62.   if (eventlist ~== 'RESULT') then
  63.   do
  64.     say 'Result:'
  65.     say eventlist
  66.   end
  67. /*
  68.  * Show the result of the above command.
  69.  */
  70.   if (doit ~= 'SHUTDOWN') then
  71.   do
  72.     'SHOW_STATUS'
  73.     if (rc ~= 0) then
  74.       say 'NazCron command: SHOW_STATUS failed with return code: '||rc
  75.     else
  76.       say 'Status: '||result
  77.   end
  78.   say
  79. end
  80.