The script file will automate the process of copying and loading patches into the PBX.
Usage:
- First copy the patches to be installed into a directory on a PCMCIA card
- The script file will need a "LIST.txt' file that contains a list of names of the patches to be installed sorted in the desired order (top of list will be installed first, usually patches are sorted in ascending order)
To create the LIST.txt:
Can be filled manually or Using a DOS command:
the LIST.txt file into the c:\\etc...\\ directory
Make sure LIST.txt doesn't include empty lines at its end and doesn't include in the list its own name "list.txt" as it can happen when u use dir /b >LIST.txt without specifying another path
- Put LIST.txt in same folder of Patch.was
- Insert the PCMCIA into the PBX
- From the PBX enter pdt mode and navigate to the directory where the patches are ex: a:\\patches
- Execute now the Patch.was script from Procomm and follow the directions of the script (Patches will be copied by the script into the pbx directory c:\\u\\patch)
NOTE: The script after copying the patches will start load them, u need to enter the pins number manually after each patch patch load...
The content of the scrip PATCH.was:
; Meridian Patch Installer ; By Fadi Rizk snipped-for-privacy@gmail.com
proc main
string Filename = "list.txt" ; File name to be opened. string Line ; Line read from file. string Answer1 string Answer2
clear usermsg " Meridian Patch Installer v1.0 " clear usermsg " Will List Directory Patch Directory " transmit "^M" transmit "pwd^M" waitfor "pdt>" Forever pause 3 transmit "ls^M" waitfor "pdt>" Forever
DIRCHECK: sdlginput "Correct Directory Check" "Is this the directory where your patches are? Y/N" Answer1 if strcmp Answer1 "Y" goto COPY elseif strcmp Answer1 "y" goto COPY elseif strcmp Answer1 "N" goto USERCANCEL elseif strcmp Answer1 "n" goto USERCANCEL else usermsg "Please Answer Y or N" goto DIRCHECK endif
COPY: usermsg " Will start copying patches now " if fopen 0 Filename READ TEXT ; Open file for read only. while not feof 0 ; Loop while not end of file. fgets 0 Line ; Get line from file. transmit "copy " transmit Line ; Display on terminal screen. transmit " c:\\u\\patch" pause 2 transmit "^M" ; Transmit Enter waitfor "pdt>" Forever
endwhile fclose 0 ; Close file opened for read. else errormsg "Couldn't open file `"%s`"." Filename
endif usermsg " Finished Copying Patches " transmit "^M" waitfor "pdt>" Forever transmit "ls c:\\u\\patch ^M" waitfor "pdt>" Forever
PATCHLOAD: sdlginput "PATCH LOADING" "Do you want start loading patches? Y/N " Answer2 if strcmp Answer2 "Y" goto LOAD elseif strcmp Answer2 "y" goto LOAD elseif strcmp Answer2 "N" goto USERCANCEL elseif strcmp Answer2 "n" goto USERCANCEL else usermsg "Please Answer Y or N" goto PATCHLOAD endif
LOAD:
transmit "^M" waitfor "pdt>" Forever transmit "cd c:\\u\\patch\\^M" waitfor "pdt>" Forever transmit "pwd^M" pause 2
if fopen 0 Filename READ TEXT ; Open file for read only. while not feof 0 ; Loop while not end of file. fgets 0 Line ; Get line from file. transmit "pload " transmit Line ; Display on terminal screen. transmit " ^M" ; Transmit Enter waitfor "pdt>" Forever pause 1 transmit "pins " pause 1 waitfor "pdt>" Forever
endwhile fclose 0 ; Close file opened for read. else errormsg "Couldn't open file `"%s`"." Filename
endif usermsg " Finished Loading Patches " goto END
USERCANCEL:
errormsg " USER CANCELLED - WILL STOP NOW"
END:
usermsg " PATCHING FINISHED - END OF PROGRAM - HAVE A NICE DAY "
endproc