ZIBRPI1 ; IHS/ADC/GTH - REMOTE PATCH INSTALLATION (1) ; [ 02/07/97 3:02 PM ]
;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
;
W !!,"EXECUTION UNAUTHORIZED.",!
Q
;
OPT ;EP - Set option in OPTION file.
I $P(^%ZOSF("OS"),"^")'["MSM" W !!,"SORRY. MSM only.",! Q
I $S('$D(DUZ(0)):1,DUZ(0)'="@":1,1:0) W !,"PROGRAMMER ACCESS REQUIRED",! Q
D HOME^%ZIS,DT^DICRW,00:'$L($P(^AUTTSITE(1,0),U,14))
NEW ZIB,ZIBAREA,D,DA,DIC,DIE,DR,I,O,POP,W
D HFS
I POP W !,"HFS not available." Q
D OS,HELP^ZIBRPI2("GEN")
S Y=1,%="Enter a number to choose the systems to which you want this report sent"
I $L($P(^AUTTSITE(1,0),U,14)) S DIR(0)="N^1:3:0",DIR("A")="Send reports to (1) "_$P($T(SYTM),";;",2)_" (2) "_$P(^(0),U,14)_" or (3) both",DIR("B")=2,DIR("?")=%,DIR("??")="^D HELP^ZIBRPI2(""SYSID"")" D DIR I $D(DIRUT) D ZISC Q
KILL DIR
S ZIBAREA="20///I "_Y
S DIR(0)="F^1:245",DIR("A")="From what "_$P(O,U)_" directory do you want to restore patches",DIR("?")="Enter the full path name of a directory",DIR("??")="^D HELP^ZIBRPI2(""DIRECT"")"
S:D("IN")]"" DIR("B")=D("IN")
; The following line is non-standard M because of the Q:$L(X)
F D DIR Q:$D(DIRUT) D HC(O("LS")_Y_"* > "_W) S IOP=I,%ZIS("IOPAR")="("""_W_""":""R"")" D ZIS U IO R X:300 U IO(0) Q:$L(X) W " Directory does not exist (or empty).",*7
S D=Y
D ZISC
Q:$D(DIRUT)
S ZIBAREA=ZIBAREA_" S:0 %="""_D
S (DIR(0),DIR("B"))="Y",DIR("A")="If action routine '(A/B)9<pkg><patch#>' exists, do you want it ran",DIR("??")="^D HELP^ZIBRPI2(""ACTION"")"
D DIR
Q:$D(DIRUT)
S ZIBAREA=ZIBAREA_U_Y_""""
S DIC="^DIC(19,",DIC(0)="",X="ZIB REMOTE PATCH INSTALLATION",DIC("DR")="1///Remote Patch Installation;4///R;"_ZIBAREA_";25///START^ZIBRPI;200///T@2315;202///1D"
F ZIB="ZIB REMOTE PATCH INSTALLATION","AZHL REMOTE PATCH INSTALLATION" I $D(^DIC(19,"B",ZIB)) S DIE=DIC,DA=$O(^DIC(19,"B",ZIB,0)),DR=".01///"_X_";"_ZIBAREA_";25///START^ZIBRPI" D DIE I 1 Q
E D FILE
W !!,"Done."
Q
;
DIE NEW D,E,F,I,J,L,N,O,P,V,W D ^DIE Q
DIR NEW D,E,F,I,J,L,N,O,P,V,W D ^DIR Q
FILE NEW D,E,F,I,J,L,N,O,P,V,W KILL DD,DO D FILE^DICN Q
HC(%) NEW D,E,F,I,J,L,N,O,P,V,W S %=$$JOBWAIT^%HOSTCMD(%) Q
XMD NEW D,E,F,I,J,L,N,O,P,V,W D ^XMD Q
ZIS NEW D,E,F,I,J,L,N,O,P,V,W D ^%ZIS Q
ZISC NEW D,E,F,I,J,L,N,O,P,V,W D ^%ZISC Q
;
HFS ;
F I=0:0 S I=$O(^%ZIS(1,I)) Q:'I I ^(I,"TYPE")="HFS" S IOP=$P(^%ZIS(1,I,0),U),%ZIS("IOPAR")="(""/usr/spool/uucppublic/work.zib"":""W"")" D ZIS Q:'POP
I 'I,'$D(POP) S POP=1
Q:POP
S I=$P(^%ZIS(1,I,0),U)
Q
;
OS ;
S O=$P($P(^%ZOSF("OS"),","),"-",2)
S O("PF")=$P($T(PATTERN^ZIBRPI),";",3)
S W=$P($T(WORK^ZIBRPI),";",3)
I O["UNIX" S (D("IN"),D("OUT"))=$P($T(PUB^ZIBRPI),";",3),O("RM")="rm ",O("LS")="ls -l ",W=D("OUT")_W Q
S %=$G(^AUTTSITE(1,1)),D("IN")=$P(%,U),D("OUT")=$P(%,U,2),O("RM")="DEL ",O("LS")="DIR /B "
Q
;
SYTM ;;dpssyg
10 ;;abr-ab
11 ;;bji-ao
20 ;;albisc
30 ;;akarea
40 ;;bilcsy
50 ;;okc-ao
51 ;;nsa-oa
61 ;;cao-as
60 ;;phx-ao
70 ;;pordps
80 ;;nav-aa
00 ;;tucdev
NEW DIE,DR,DA
S DA=$P($T(@($P(^AUTTAREA($P(^AUTTLOC($P(^AUTTSITE(1,0),U),0),U,4),0),U,2))),";;",2),DR="W $J("""",IOM-$L(X)\2)_X,!!"
W !!
F X="A system id for your area computer does not exist in the RPMS SITE file.","Based on your area code, it should probably be '"_DA_"'.","Please enter an area system id into the RPMS SITE file, now.","(Calling DIE for you)." X DR
S DIE="^AUTTSITE(",DR=".14//"_DA,DA=1
D DIE
Q
ZIBRPI1 ; IHS/ADC/GTH - REMOTE PATCH INSTALLATION (1) ; [ 02/07/97 3:02 PM ]
+1 ;;3.0;IHS/VA UTILITIES;;FEB 07, 1997
+2 ;
+3 WRITE !!,"EXECUTION UNAUTHORIZED.",!
+4 QUIT
+5 ;
OPT ;EP - Set option in OPTION file.
+1 IF $PIECE(^%ZOSF("OS"),"^")'["MSM"
WRITE !!,"SORRY. MSM only.",!
QUIT
+2 IF $SELECT('$DATA(DUZ(0)):1,DUZ(0)'="@":1,1:0)
WRITE !,"PROGRAMMER ACCESS REQUIRED",!
QUIT
+3 DO HOME^%ZIS
DO DT^DICRW
IF '$LENGTH($PIECE(^AUTTSITE(1,0),U,14))
DO 00
+4 NEW ZIB,ZIBAREA,D,DA,DIC,DIE,DR,I,O,POP,W
+5 DO HFS
+6 IF POP
WRITE !,"HFS not available."
QUIT
+7 DO OS
DO HELP^ZIBRPI2("GEN")
+8 SET Y=1
SET %="Enter a number to choose the systems to which you want this report sent"
+9 IF $LENGTH($PIECE(^AUTTSITE(1,0),U,14))
SET DIR(0)="N^1:3:0"
SET DIR("A")="Send reports to (1) "_$PIECE($TEXT(SYTM),";;",2)_" (2) "_$PIECE(^(0),U,14)_" or (3) both"
SET DIR("B")=2
SET DIR("?")=%
SET DIR("??")="^D HELP^ZIBRPI2(""SYSID"")"
DO DIR
IF $DATA(DIRUT)
DO ZISC
QUIT
+10 KILL DIR
+11 SET ZIBAREA="20///I "_Y
+12 SET DIR(0)="F^1:245"
SET DIR("A")="From what "_$PIECE(O,U)_" directory do you want to restore patches"
SET DIR("?")="Enter the full path name of a directory"
SET DIR("??")="^D HELP^ZIBRPI2(""DIRECT"")"
+13 IF D("IN")]""
SET DIR("B")=D("IN")
+14 ; The following line is non-standard M because of the Q:$L(X)
+15 FOR
DO DIR
IF $DATA(DIRUT)
QUIT
DO HC(O("LS")_Y_"* > "_W)
SET IOP=I
SET %ZIS("IOPAR")="("""_W_""":""R"")"
DO ZIS
USE IO
READ X:300
USE IO(0)
IF $LENGTH(X)
QUIT
WRITE " Directory does not exist (or empty).",*7
+16 SET D=Y
+17 DO ZISC
+18 IF $DATA(DIRUT)
QUIT
+19 SET ZIBAREA=ZIBAREA_" S:0 %="""_D
+20 SET (DIR(0),DIR("B"))="Y"
SET DIR("A")="If action routine '(A/B)9<pkg><patch#>' exists, do you want it ran"
SET DIR("??")="^D HELP^ZIBRPI2(""ACTION"")"
+21 DO DIR
+22 IF $DATA(DIRUT)
QUIT
+23 SET ZIBAREA=ZIBAREA_U_Y_""""
+24 SET DIC="^DIC(19,"
SET DIC(0)=""
SET X="ZIB REMOTE PATCH INSTALLATION"
SET DIC("DR")="1///Remote Patch Installation;4///R;"_ZIBAREA_";25///START^ZIBRPI;200///T@2315;202///1D"
+25 FOR ZIB="ZIB REMOTE PATCH INSTALLATION","AZHL REMOTE PATCH INSTALLATION"
IF $DATA(^DIC(19,"B",ZIB))
SET DIE=DIC
SET DA=$ORDER(^DIC(19,"B",ZIB,0))
SET DR=".01///"_X_";"_ZIBAREA_";25///START^ZIBRPI"
DO DIE
IF 1
QUIT
+26 IF '$TEST
DO FILE
+27 WRITE !!,"Done."
+28 QUIT
+29 ;
DIE NEW D,E,F,I,J,L,N,O,P,V,W
DO ^DIE
QUIT
DIR NEW D,E,F,I,J,L,N,O,P,V,W
DO ^DIR
QUIT
FILE NEW D,E,F,I,J,L,N,O,P,V,W
KILL DD,DO
DO FILE^DICN
QUIT
HC(%) NEW D,E,F,I,J,L,N,O,P,V,W
SET %=$$JOBWAIT^%HOSTCMD(%)
QUIT
XMD NEW D,E,F,I,J,L,N,O,P,V,W
DO ^XMD
QUIT
ZIS NEW D,E,F,I,J,L,N,O,P,V,W
DO ^%ZIS
QUIT
ZISC NEW D,E,F,I,J,L,N,O,P,V,W
DO ^%ZISC
QUIT
+1 ;
HFS ;
+1 FOR I=0:0
SET I=$ORDER(^%ZIS(1,I))
IF 'I
QUIT
IF ^(I,"TYPE")="HFS"
SET IOP=$PIECE(^%ZIS(1,I,0),U)
SET %ZIS("IOPAR")="(""/usr/spool/uucppublic/work.zib"":""W"")"
DO ZIS
IF 'POP
QUIT
+2 IF 'I
IF '$DATA(POP)
SET POP=1
+3 IF POP
QUIT
+4 SET I=$PIECE(^%ZIS(1,I,0),U)
+5 QUIT
+6 ;
OS ;
+1 SET O=$PIECE($PIECE(^%ZOSF("OS"),","),"-",2)
+2 SET O("PF")=$PIECE($TEXT(PATTERN^ZIBRPI),";",3)
+3 SET W=$PIECE($TEXT(WORK^ZIBRPI),";",3)
+4 IF O["UNIX"
SET (D("IN"),D("OUT"))=$PIECE($TEXT(PUB^ZIBRPI),";",3)
SET O("RM")="rm "
SET O("LS")="ls -l "
SET W=D("OUT")_W
QUIT
+5 SET %=$GET(^AUTTSITE(1,1))
SET D("IN")=$PIECE(%,U)
SET D("OUT")=$PIECE(%,U,2)
SET O("RM")="DEL "
SET O("LS")="DIR /B "
+6 QUIT
+7 ;
SYTM ;;dpssyg
10 ;;abr-ab
11 ;;bji-ao
20 ;;albisc
30 ;;akarea
40 ;;bilcsy
50 ;;okc-ao
51 ;;nsa-oa
61 ;;cao-as
60 ;;phx-ao
70 ;;pordps
80 ;;nav-aa
00 ;;tucdev
+1 NEW DIE,DR,DA
+2 SET DA=$PIECE($TEXT(@($PIECE(^AUTTAREA($PIECE(^AUTTLOC($PIECE(^AUTTSITE(1,0),U),0),U,4),0),U,2))),";;",2)
SET DR="W $J("""",IOM-$L(X)\2)_X,!!"
+3 WRITE !!
+4 FOR X="A system id for your area computer does not exist in the RPMS SITE file.","Based on your area code, it should probably be '"_DA_"'.","Please enter an area system id into the RPMS SITE file, now.","(Calling DIE for you)."
XECUTE DR
+5 SET DIE="^AUTTSITE("
SET DR=".14//"_DA
SET DA=1
+6 DO DIE
+7 QUIT