home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netdor3.zip / DISK_13 / IMAGE12.ZIP / CATALOG / netdx.cmd < prev    next >
OS/2 REXX Batch file  |  1994-12-12  |  2KB  |  89 lines

  1. /**/
  2. /*
  3. say 'Starting NETDX.CMD processing'
  4. pull a
  5. trace ?r */
  6. say left(date(ordered) time(),18)'- NetDoor Exit started...'
  7.  
  8. call RxFuncAdd 'RXCOUINFO','COUENV','RXCOUINFO'
  9. call RxFuncAdd 'RxOS2Ini','RXUTILS','RxOS2Ini'
  10. inifile=RXCOUINFO('GET','INIFILE')
  11.  
  12. parse arg arguments
  13. call GetMsg arguments
  14. parse var result MsgId MsgVars
  15.  
  16. if NetDoorInvolved(MsgId,MsgVars)='YES' then
  17.   do
  18.     call ProcessMsg MsgId, MsgVars
  19.   end
  20. say left(date(ordered) time(),18)'- NetDoor Exit ended...'
  21. exit
  22.  
  23.  
  24. GetMsg: procedure
  25. parse arg MsgId Msgvars
  26. /**/
  27. return MsgId Msgvars
  28.  
  29. NetDoorInvolved: procedure
  30. parse arg MsgId, MsgVars
  31. Involved='NO'
  32. if (Msgid='221') | (Msgid='225') | (Msgid='222') | (Msgid='226') then
  33.    Involved='YES'
  34. else
  35.    Involved='NO'
  36. return Involved /*'YES','NO'*/
  37.  
  38.  
  39. ProcessMsg: procedure expose inifile
  40. parse arg MsgId, MsgVars
  41. select
  42.   when MsgId=221 then /* Install ok */
  43.     do
  44. /*    call AddProg GetNetDoorName(MsgVars)*/
  45.       call SignalNdmEnd 0
  46.     end
  47.   when MsgId=225 then /* Install ko */
  48.     do
  49.       call SignalNdmEnd -111
  50.       /* Clean up ; Signal */
  51.     end
  52.   when MsgId=222 then /* Remove  ok */
  53.     do
  54. /*     call RemProg GetNetDoorName(MsgVars)*/
  55.       call SignalNdmEnd 0
  56.     end
  57.   when MsgId=226 then /* Remove  ko */
  58.     do
  59.       call SignalNdmEnd -222
  60.       /* Clean up ; Signal */
  61.     end
  62.   otherwise
  63.     nop
  64. end
  65. return
  66.  
  67. GetNetDoorName: procedure
  68. parse arg NVDM2GlobalName
  69. NetDoorName='dmobqry'(NVDM2GlobalName)
  70. return NetDoorName
  71.  
  72. AddProg: procedure expose inifile
  73. parse arg prog
  74. call RxOS2Ini inifile,"COREADDED",prog,".\.\"date(european)"\"left(time(),5)
  75. return result
  76.  
  77. RemProg: procedure expose inifile
  78. parse arg prog
  79. call RxOS2Ini inifile,"COREADDED",prog,"$RXDEL"
  80. return result
  81.  
  82. SignalNdmEnd:
  83. parse arg rc
  84. rqname="IBMCOUDM2"
  85. qname=rxqueue("Set",rqname)
  86. queue rc
  87. return
  88.  
  89.