home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / upsmange.zip / CLIENT / SERVER / UMC_BRDC.CMD next >
OS/2 REXX Batch file  |  1995-11-22  |  3KB  |  70 lines

  1. /*******************************************************************/
  2. /*     Broadcast Script UM-Client 2.0 (Lan Server)                 */
  3. /*******************************************************************/
  4. /*                                                                 */
  5. /* This REXX script may use the following parameters :             */
  6. /*                                                                 */
  7. /* 1  Message name (same as defined in message file (UMC_MESG)     */
  8. /* 2  Message to send to users : YES or NO                         */
  9. /* 3  Message text                                                 */
  10. /*                                                                 */
  11. /* Example of customization :                                      */
  12. /*                                                                 */
  13. /* if msgName ="Agent_Communication_Failed" then                   */
  14. /*   do                                                            */
  15. /*    specific action ...                                          */
  16. /*   end                                                           */
  17. /* else                                                            */
  18. /*   do                                                            */
  19. /*    specific action ...                                          */
  20. /*   end                                                           */
  21. /*                                                                 */
  22. /*******************************************************************/
  23.  
  24. /* Parse arguments 1, 2 & 3 */
  25. PARSE ARG '"'msgName'" "'msgYesNo'" "'msgText'"' 
  26.  
  27. /* Disable local echo of system commands */
  28. '@echo off'
  29.  
  30. /* Get Host name */
  31. 'hostname > umc_name.tmp'
  32. CALL STREAM 'umc_name.tmp','c','open read'
  33. UMC_NAME=LINEIN('umc_name.tmp')
  34. CALL STREAM 'umc_name.tmp','c','close'
  35. 'del umc_name.tmp'
  36.  
  37. /* Build message into a temporary file */
  38. CALL STREAM 'umc_msg.tmp','c','open write'
  39.  
  40. blankline = " "
  41. sepline = "-----------------------------------------------" 
  42. header = "         UM-Client : "UMC_NAME
  43. call lineout 'umc_msg.tmp',sepline
  44. call lineout 'umc_msg.tmp',blankline
  45. call lineout 'umc_msg.tmp',header
  46. call lineout 'umc_msg.tmp',blankline
  47. call lineout 'umc_msg.tmp',sepline
  48. call lineout 'umc_msg.tmp',msgText
  49. call lineout 'umc_msg.tmp',sepline
  50.  
  51. CALL STREAM 'umc_msg.tmp','c','close'
  52.  
  53. /* Sends broadcast message to all administrators defined in umc_fadm file */
  54. fic_adm = 'umc_fadm'
  55. admin=LINEIN(fic_adm)
  56. DO WHILE admin > 0
  57.   'NET SEND 'admin' < umc_msg.tmp'
  58.   admin=LINEIN(fic_adm)
  59. END
  60.  
  61. /* Sends broadcast message to all users */
  62. IF msgYesNo="YES"
  63.   THEN 'NET SEND /users < umc_msg.tmp' 
  64.  
  65. 'del umc_msg.tmp'
  66.  
  67. EXIT
  68.  
  69.  
  70.