home *** CD-ROM | disk | FTP | other *** search
- /* bootck.rexx Checks floppies for viruses and saves a irregular block */
- no_boot = 'No bootblock installed'
- real_boot = 'ARP thinks OK bootblock' /* this is arp's msg on OK bootblock */
- /* if you use the CBM install program you must change the above string
- to reflect the CBM message
- You will also have to change the name of the disk/dir you want your
- non-standard boot blocks saved to
- */
- YES = 1
- NO = 0
- STARTUP_SEQ = NO
- SAVE = 0
- BOOT = 1
- NOBOOT = 2
- WriteProtect = TRUE /* I disk write protect status */
-
- arg vol /* gotta enter a volume name */
- vol = upper(vol)
-
- if length(vol) < 4 then do
- say " You GOTTA Enter A Disk to check !!"
- exit
- end
-
- select
- when compare(vol,'DF0:') = 0 then call fixit
- when compare(vol,'DF1:') = 0 then call fixit
- /* if you have df2: and df3: un - comment the below */
- /* when compare(vol,'DF2:') = 0 then call fixit */
- /* when compare(vol,'DF3:') = 0 then call fixit */
- otherwise say 'Drive Name Entry Error'
- end
- exit
-
-
- /* CHECK FOR NON STANDARD BOOT BLOCK */
- ""'install 'vol 'check | execio for 1 var boot_ck'
-
- /* CHECK FOR EXISTENCE OF STARTUP-SEQUENCE */
- if exists(vol's/startup-sequence') then STARTUP_SEQ = YES
-
- /* * * * * * * * * * STARTUP-SEQUENCE NOT FOUND ON DISK * * * * * * * * * */
- if STARTUP_SEQ == NO then do
- if compare(boot_ck,no_boot) == 0 then do /* no boot block */
- say 'no startup-sequence,no boot block'
- exit
- end
-
- if compare(boot_ck,real_boot) ~= 0 then do /* boot non standard */
- say 'there is NO startup-sequence BUT'
- say 'There is a Non-Standard Boot Block'
- call yes_no 'DE-Install 'vol '?'
- if result == YES then call install_disk NOBOOT /* DE-INSTALL ? */
- else say "Okay but it might Be A Virus !!"
- exit
- end
-
- else if compare(boot_ck,real_boot) == 0 then do
- say 'there is NO startup-sequence BUT'
- say 'there is a VALID Boot block' /* DE-INSTALL ? */
- call yes_no 'De-Install 'vol '?'
- if result == YES then call install_disk NOBOOT
- exit
- end
- end
-
- /* * * * * * * * * * STARTUP-SEQUENCE LOCATED ON DISK * * * * * * * * * */
- if STARTUP_SEQ == YES then do
- if compare(boot_ck,no_boot) == 0 then do /* no boot block */
- say 'there is a startup-sequence on this disk'
- say 'but No boot block is installed'
- call yes_no 'Install Boot Block on 'vol '?'
- if result = YES then call install_disk BOOT
- end
-
- else if compare(boot_ck,real_boot) ~= 0 then do /* boot non standard */
- say 'there is a startup-sequence BUT'
- say 'Boot Block is non-standard '
- call yes_no 'Install standard Boot Block on 'vol '?'
- if result = YES then call install_disk SAVE /* save non std ? */
- else say "Ok but it might be a VIRUS .."
- end
-
- end /* end seq = yes */
-
-
- install_disk:
- arg bt
-
- /* check for a write protected disk */
- ""'info 'vol' | execio from 4 for 1 var diskinfo' /* get info on disk */
- if compare(word(diskinfo,7),'Read') == 0 then do
- say 'Disk is write protected !!'
- exit
- end
- /* DE_INSTALL DISK */
- if bt == NOBOOT = 1 then do forever
- ""'install 'vol 'noboot'
- ""'install 'vol 'check | execio for 1 var boot_ck' /* re-check the disk */
- if compare(boot_ck,no_boot) == 0 then do
- say "NOW UN-BOOTABLE"
- return
- end
- else do
- call yes_no "CAN'T UN-INSTALL THIS DISK !!..Retry ?"
- if result = NO then return
- end
- end
-
- if bt == SAVE then do /* save non-std */
- call gdname vol
- x = '"' || getclip('DNAME') || '"'
- say 'saving bootblock to dh1:new/'diskname
- ""'bootback 'vol' dh1:new/'diskname
- ""'filenote dh1:new/'diskname 'bootblock'
- end
-
- /* INSTALL GOOD BOOT BLOCK */
- do forever
- ""'install 'vol /* install disk */
- ""'install 'vol 'check | execio for 1 var boot_ck'
- if compare(boot_ck,real_boot) == 0 then do
- say "Boot Block is now Correct "
- return
- end
-
- else do /* could not correct bad boot block */
- call yes_no "Error Installing this disk.. RETRY ?"
- if result = NO then return
- end
- end
-
-