home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 321.lha / NazCron_v1.02 / NC.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1989-12-11  |  2.3 KB  |  88 lines

  1. /************************/
  2. /* NC.rexx              */
  3. /* 11/12/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.   say '  Commands:  SHUTDOWN  SUSPEND  RESUME LOCK_EVENTS UNLOCK_EVENTS'
  49.   say
  50.   say '             NEW_EVENT_FILE CLOSE_EVENT_FILE'
  51.   say
  52.   say '             ADD_EVENT DELETE_EVENT DELETE_REXX_EVENT PURGE_REXX_EVENTS'
  53.   say
  54.   say '             SHOW_STATUS SHOW_EVENT LIST_EVENTS'
  55.   say
  56.   exit 20
  57. end
  58.  
  59. say
  60.  
  61. address NAZCRON
  62. doit = upper(doit)
  63. doit
  64. if (rc ~= 0) then
  65.   say 'NazCron command: '||doit||' failed with return code: '||rc
  66. else
  67. do
  68.   say 'NazCron command: '||doit||' was successful'
  69.   eventlist = result
  70.   if (eventlist ~== 'RESULT') then
  71.   do
  72.     say 'Result:'
  73.     say eventlist
  74.   end
  75. /*
  76.  * Show the result of the above command.
  77.  */
  78.   if (doit ~= 'SHUTDOWN') then
  79.   do
  80.     'SHOW_STATUS'
  81.     if (rc ~= 0) then
  82.       say 'NazCron command: SHOW_STATUS failed with return code: '||rc
  83.     else
  84.       say 'Status: '||result
  85.   end
  86.   say
  87. end
  88.