home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ijlog_10.zip / setup.cmd < prev   
OS/2 REXX Batch file  |  1999-02-12  |  6KB  |  191 lines

  1. /* */
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6. parse upper arg type
  7.  
  8. run_type = 0
  9.  
  10. if type = "INSTALL" then do
  11.     run_type = 1
  12. end
  13.  
  14. if type = "CONFIGURE" then do
  15.     run_type = 2
  16. end
  17.  
  18. if run_type = 0 then do
  19.     say "Missing or invalid parameter encountered."
  20.     say "Type 'setup install' to install this software, or"
  21.     say "type 'setup configure' to re-configure it after installation."
  22.     exit
  23. end
  24.  
  25. configfile = 'logread.cfg'
  26.  
  27. say
  28. say "This program will install and/or configure the log reading"
  29. say "system. The following software is required:"
  30. say " - In-Joy version 2.0 with firewall enabled"
  31. say " - Some WEB-server running on the same machine,"
  32. say "   capable of running REXX scripts as cgi-bin's"
  33. say " - Some scheduling program able to run the read_log.cmd"
  34. say "   script at certain intervals"
  35. say
  36. say "MAKE SURE YOU READ THE FILE "README.TXT" PRIOR TO INSTALL OR USE!!"
  37. say
  38. if run_type = 1 then do
  39.     say "You have selected to INSTALL this software for the first time."
  40.     call install
  41.     exit
  42. end
  43. if run_type = 2 then do
  44.     say "You have selected to re-CONFIGURE this software."
  45.     call configure
  46.     exit
  47. end
  48.  
  49. install:
  50.     say
  51.     say
  52.     say "You will now be asked a few questions about where files are to be placed."
  53.     say "All questions are to be answered with FULLY QUALIFIED path names, but"
  54.     say "WITHOUT trailing backslash ( \ ). All paths must also exist."
  55.     say
  56.     say "Enter the directory containing In-Joy 2.0."
  57.     say "(default: c:\in-joy)"
  58.     pull injoy_home
  59.     if injoy_home = "" then injoy_home = "c:\in-joy"
  60.     say
  61.     say "Enter the full path to where you want to store the base program"
  62.     say "and the HTML files."
  63.     say "(default: "injoy_home"\logread)"
  64.     pull base_home
  65.     if base_home = "" then base_home = injoy_home'\logread'
  66.     say
  67.     say "Enter the directory where you want to store the datafiles."
  68.     say "(default: "injoy_home"\logread\data)"
  69.     pull datafiles_home
  70.     if datafiles_home = "" then datafiles_home = injoy_home'\logread\data'
  71.     say
  72.     say "Enter the full path to the cgi-bin directory of the web server"
  73.     say "running on this machine."
  74.     say "(default: c:\servers\web\cgi-bin)"
  75.     pull cgibin_home
  76.     if cgibin_home = "" then cgibin_home = "c:\servers\web\cgi-bin"
  77.     say
  78.     say
  79.     say "Ok, now we'll start copying files. Just make sure the following"
  80.     say "directories exists already, prior to continuing:"
  81.     say
  82.     say injoy_home
  83.     say base_home
  84.     say datafiles_home
  85.     say cgibin_home
  86.     say
  87.     say "If they do, press ENTER to start copying files, or"
  88.     say "type EXIT and press ENTER to quit now."
  89.     pull continue
  90.     if continue = "EXIT" then exit
  91.     say
  92.     'unzip logread.zip -d 'base_home
  93.     'unzip cgibin.zip -d 'cgibin_home
  94.     say "Do you want to copy a sample users file to the datafile directory?"
  95.     say "Type YES and press enter for yes, anything else (or nothing) for no."
  96.     say "(Note: YES will OVERWRITE any existing userfile in this dir!!)"
  97.     pull copyyesno
  98.     if substr(copyyesno,1,1) = "Y" then do
  99.         'copy sample.usr 'datafiles_home'\users.lst'
  100.     end
  101.     say
  102.     say
  103.     say "All files should be in place now. If anything went wrong, blame"
  104.     say "someone else. Now let's get the last piece of information..."
  105.     say
  106.     say "How many currency units do you wish to charge per time unit?"
  107.     say "Remember to use . as floating point..."
  108.     say "(Read README.TXT to understand this question)"
  109.     pull charge
  110.     if charge = "" then charge = "1"
  111.     say
  112.     say
  113.     say "Ok, now let's write the config file and distribute it to where"
  114.     say "it's needed..."
  115.     say
  116.     call SysFileDelete configfile
  117.     call stream configfile, 'command', 'open write'
  118.     res=lineout(configfile,injoy_home)
  119.     res=lineout(configfile,datafiles_home)
  120.     res=lineout(configfile,charge)
  121.     call stream configfile, 'command', 'close'
  122.     say "Settings saved."
  123.     say
  124.     'copy 'configfile' 'base_home
  125.     'copy 'configfile' 'cgibin_home
  126.     'copy 'configfile' 'cgibin_home'\..\'
  127.     say
  128.     say "All done. If you haven't already, RTFM!! (readme.txt)"
  129.     say "Bye."
  130.     exit
  131. return
  132.  
  133. configure:
  134.     say
  135.     say
  136.     say "You will now be asked a few questions about where files are to be found."
  137.     say "All questions are to be answered with FULLY QUALIFIED path names, but"
  138.     say "WITHOUT trailing backslash ( \ ). All paths must also exist."
  139.     say
  140.     say "Enter the directory containing In-Joy 2.0."
  141.     say "(default: c:\in-joy)"
  142.     pull injoy_home
  143.     if injoy_home = "" then injoy_home = "c:\in-joy"
  144.     say
  145.     say "Enter the full path to where you stored the base program"
  146.     say "and the HTML files."
  147.     say "(default: "injoy_home"\logread)"
  148.     pull base_home
  149.     if base_home = "" then base_home = injoy_home'\logread'
  150.     say
  151.     say "Enter the directory where you stored the datafiles."
  152.     say "(default: "injoy_home"\logread\data)"
  153.     pull datafiles_home
  154.     if datafiles_home = "" then datafiles_home = injoy_home'\logread\data'
  155.     say
  156.     say "Enter the full path to the cgi-bin directory of the web server"
  157.     say "running on this machine."
  158.     say "(default: c:\servers\web\cgi-bin)"
  159.     pull cgibin_home
  160.     if cgibin_home = "" then cgibin_home = "c:\servers\web\cgi-bin"
  161.     say
  162.     say
  163.     say "How many currency units do you wish to charge per time unit?"
  164.     say "Remember to use . as floating point..."
  165.     say "(Read README.TXT to understand this question)"
  166.     pull charge
  167.     if charge = "" then charge = "1"
  168.     say
  169.     say
  170.     say "Ok, now let's write the config file and distribute it to where"
  171.     say "it's needed..."
  172.     say
  173.     call SysFileDelete configfile
  174.     call stream configfile, 'command', 'open write'
  175.     res=lineout(configfile,injoy_home)
  176.     res=lineout(configfile,datafiles_home)
  177.     res=lineout(configfile,charge)
  178.     call stream configfile, 'command', 'close'
  179.     say "Settings saved."
  180.     say
  181.     'copy 'configfile' 'base_home
  182.     'copy 'configfile' 'cgibin_home
  183.     'copy 'configfile' 'cgibin_home'\..\'
  184.     say
  185.     say "All done. If you haven't already, RTFM!! (readme.txt)"
  186.     say "Bye."
  187.     exit
  188. return
  189.  
  190.  
  191.