home *** CD-ROM | disk | FTP | other *** search
- # Configuration script for Demon setup program.
- # 22 Dec 94 Colin Hogben : First full version.
- # 15 Feb 95 Colin Hogben : Added fetching of IP address via SLIPdial
- # 18 Feb 95 Colin Hogben : Don't wipe !NewsDir
- # 19 Feb 95 Colin Hogben : Added selection of PoP
- # 20 Feb 95 Colin Hogben : Modified handling of preferred PoP
- # 26 Feb 95 Colin Hogben : Fix to use new Sportster driver in SLIPdial
- # 19 Mar 95 Colin Hogben : Allow hyphen in node name; handle TCPIP 2.04
- # Read timezone for Newsbase setup
- # 02 May 95 Colin Hogben : Update for Newsbase 0.54; add Courier modem; run !Help.
- # 03 May 95 Colin Hogben : Replace Hensa with mirror in FTP menus; add finger status@gate
- # 14 May 95 Colin Hogben : Add more modems; check Demon password
- # 25 May 95 Colin Hogben : Set btorhg variable for new SLIPdial config file
- # 27 May 95 Colin Hogben : Now 3 PoPs for new SLIPdial script
-
- #--- Ensure !Help is running
- if "<Help$Dir>" = ""
- cli Run Resources:$.Apps.!Help
- endif
-
- #--- Fetch initial defaults for user-settable fields
- cli Obey <DemConfig$Dir>.Choices
- set modem DemConfig$Modem
- set serial DemConfig$Serial
- set cable DemConfig$Cable
- set speed DemConfig$Speed
- if DemConfig$Speed = 0
- if DemConfig$RiscPC
- set speed 57600
- else
- set speed 19200
- endif
- endif
- set btorhg DemConfig$BtOrHg
- set hgpin DemConfig$HgPin
- set hglocal DemConfig$HgLocal
- set pop1 DemConfig$PoP1
- set pop2 DemConfig$PoP2
- set pop3 DemConfig$PoP3
-
- set userid DemConfig$UserId
- set realname DemConfig$RealName
- set org DemConfig$Org
-
- set node DemConfig$Node
- set dempw DemConfig$DemPw
-
- #--- The IP address can be modified by the SLIPdial script
- #--- Default is to fetch via SLIPdial only if not valid
- cli Obey <DemConfig$Dir>.IpAddr
- set ip_addr DemConfig$IpAddr
- cli BASIC -quit <DemConfig$Dir>.CheckIp
- set getip DemConfig$IpValid = 0
-
- cli BASIC -quit <DemConfig$Dir>.TimeZone
- set timezone DemConfig$TimeZone
-
- #--- Come back here if errors in user data detected
- label retry
-
- #--- Begin the window definition
- window
-
- # Group some related options together into a box...
- group "Modem & serial interface"
- menuchoice modem "Modem type" \
- "Miracom" \
- "SupraFax 14400=Supra14k4" \
- "USR Sportster 14400=USR" \
- "USR Courier 28800=Courier28k" \
- "USR Courier=Courier" \
- "Zoom 14400=Zoom14k4" \
- "Other (ATZ)=ATZ"
- #--- There ought to be more drivers; we need people to tell us what works
-
- menuchoice serial "Serial port" \
- Internal=int \
- "Dual Serial card (port 0)=dual0" \
- "Dual Serial card (port 1)=dual1"
- menuchoice cable "Cable type" \
- "Arc=arc" \
- "PC=pc"
- string speed "Serial speed" 10 0-9
- endgroup
-
- group "Phone details"
- flag btorhg "Mercury available" "bt" "mercury"
- string hgpin "Mercury PIN" 20 0-9,
- flag hglocal "Use Mercury for all PoPs" 0 -1
-
- #--- Alternative versions needed for SLIPdial 12-character limit.
- #--- Yes, I know it's bad form having the same information thrice.
- menuchoice pop1 "Nearest PoP" \
- "Birmingham" "Bradford" "Bristol" \
- "Cambridge" "Cardiff" "Coventry" \
- "Edinburgh" "Gloucester" "Hull" \
- "Isle of Wight=I. of Wight" "Leeds" "Leicester" \
- "Liverpool" "London" "Luton" \
- "Manchester" "Newcastle" "Nottingham" \
- "Preston" "Reading" "Saffron Walden=Saffron W." \
- "Sheffield" "Sunderland" "Wolverhampton=Wolv'hampton"
-
- menuchoice pop2 "2nd choice PoP" \
- "Birmingham" "Bradford" "Bristol" \
- "Cambridge" "Cardiff" "Coventry" \
- "Edinburgh" "Gloucester" "Hull" \
- "Isle of Wight=I. of Wight" "Leeds" "Leicester" \
- "Liverpool" "London" "Luton" \
- "Manchester" "Newcastle" "Nottingham" \
- "Preston" "Reading" "Saffron Walden=Saffron W." \
- "Sheffield" "Sunderland" "Wolverhampton=Wolv'hampton"
-
- menuchoice pop3 "3rd choice PoP" \
- "Birmingham" "Bradford" "Bristol" \
- "Cambridge" "Cardiff" "Coventry" \
- "Edinburgh" "Gloucester" "Hull" \
- "Isle of Wight=I. of Wight" "Leeds" "Leicester" \
- "Liverpool" "London" "Luton" \
- "Manchester" "Newcastle" "Nottingham" \
- "Preston" "Reading" "Saffron Walden=Saffron W." \
- "Sheffield" "Sunderland" "Wolverhampton=Wolv'hampton"
- endgroup
-
- group "Demon account"
- # variable name label len validation
- string node "Node name" 8 A-Za-z0-9-
- string dempw Password 8
- string ip_addr "Internet adrs" 15 0-9.
- flag getip "Call Demon now to get IP address" 0 -1
- endgroup
-
- group "User details"
- string userid Userid 8
- string realname Name 40
- string org Organisation 40
- endgroup
-
- #--- Let the user fill in the details
- endwindow
-
- #--- Save the choices made so far.
- translate <DemConfig$Res>.Choices <DemConfig$Dir>.Choices
- translate <DemConfig$Res>.IpAddr <DemConfig$Dir>.IpAddr
-
- #--- Munge the serial parameters
- if "{serial}" = "int"
- set driver "Internal"
- set port 0
- elseif "{serial}" = "dual0"
- set driver "sp_dual"
- set port 0
- elseif "{serial}" = "dual1"
- set driver "sp_dual"
- set port 1
- endif
- if "{cable}" = "pc"
- set driver "{driver}PC"
- endif
-
- set modemdriver "{modem}"
- if "{modem}" = "Miracom"
- set modemdriver "USR"
- endif
-
- #--- Look up the phone numbers for the chosen PoPs.
- #--- Yucky implementation of a loop. The surrounding if is a hack
- # to stop it complaining of label redefinition if you retry.
- if 1
- set i 1
- set pop "{pop1}"
- label poploop
- if "{pop}" = "Birmingham"
- set num "01212754848"
- elseif "{pop}" = "Bradford"
- set num "01274755066"
- elseif "{pop}" = "Bristol"
- set num "01179814848"
- elseif "{pop}" = "Cambridge"
- set num "01223576010"
- elseif "{pop}" = "Cardiff"
- set num "01222274848"
- elseif "{pop}" = "Coventry"
- set num "01203284848"
- elseif "{pop}" = "Edinburgh"
- set num "01315528883"
- elseif "{pop}" = "Gloucester"
- set num "01452354848"
- elseif "{pop}" = "Hull"
- set num "01482495580"
- elseif "{pop}" = "I. of Wight"
- set num "01983523306"
- elseif "{pop}" = "Leeds"
- set num "01132984848"
- elseif "{pop}" = "Leicester"
- set num "01162904848"
- elseif "{pop}" = "Liverpool"
- set num "01512104848"
- elseif "{pop}" = "London"
- set num "01813384848"
- elseif "{pop}" = "Luton"
- set num "01582644848"
- elseif "{pop}" = "Manchester"
- set num "01613854848"
- elseif "{pop}" = "Newcastle"
- set num "01912474848"
- elseif "{pop}" = "Nottingham"
- set num "01159544848"
- elseif "{pop}" = "Preston"
- set num "01772484848"
- elseif "{pop}" = "Reading"
- set num "01734284848"
- elseif "{pop}" = "Saffron W."
- set num "01799506010"
- elseif "{pop}" = "Sheffield"
- set num "01142384848"
- elseif "{pop}" = "Sunderland"
- set num "01915225005"
- elseif "{pop}" = "Wolv'hampton"
- set num "01902464848"
- else
- error Internal error - no number for {pop}
- endif
- set num{i} "{num}"
- set i {i} + 1
- if {i} = 2
- set pop "{pop2}"
- goto poploop
- elseif {i} = 3
- set pop "{pop3}"
- goto poploop
- endif
- endif
-
- if {hglocal}
- set nopredial 0
- else
- set nopredial "{num1}"
- endif
-
- #--- See if the user wants to call Demon to get the IP address
- if {getip}
-
- #--- Demon want passwords to be between 5 to 8 characters long
- cli Set DemConfig$DemPw "{dempw}"
- cli BASIC -quit <DemConfig$Dir>.CheckDemPw
- set err "<DemConfig$PwError>"
- if "{err}" <> ""
- error {err}
- goto retry
- endif
-
- confirm ok About to ring Demon ({pop1}) to set password and get IP address. Check your modem is set up.
- if {ok} = 0
- goto retry
- endif
-
- substitution {{ }}
- translate <DemConfig$Res>.FirstDemon <DemConfig$Dir>.FirstDemon
- substitution { }
- cli run <Internet$Dir>.!SerialDev.!Boot
- cli Run <Internet$Dir>.!SLIPdial -file <DemConfig$Dir>.FirstDemon
- #--- "I'll be back..." (restarted by the SLIPdial script)
- exit
- endif
-
- #--- Check that the IP address is valid
- cli set DemConfig$IpAddr {ip_addr}
- cli BASIC -quit <DemConfig$Dir>.CheckIp
- if DemConfig$IpValid = 0
- error Invalid IP address {ip_addr}
- goto retry
- endif
-
- #--- Now do the actual configuration
- set domain "demon.co.uk"
- set host "{node}.{domain}"
- set inetdir Internet$Dir
-
- #--- Set up TCPIP. Note TCPIP$Dir is !TCPIPUser, not !TCPIP.
- #--- Use temp variables to stop command line getting too long
- cli set temp <Internet$Dir>.!TCPIPUser
- substitution {{ }}
- translate <DemConfig$Res>.TCPconfig <temp>.Config
- substitution { }
- translate <DemConfig$Res>.Domain <temp>.Domain
- copy <DemConfig$Res>.AutoExec <temp>.AutoExec
- copy <DemConfig$Res>.DemGroup <temp>.NNTP.DemGroup
- #--- Hensa restricts non-ac.uk users so substitute Demon's mirror of it
- copy <DemConfig$Res>.FTPmenu <temp>.Menus.FTP
- copy <DemConfig$Res>.DemSubDir <temp>.Menus.DemSubDir
- copy <DemConfig$Res>.FingerMenu <temp>.Menus.Finger
-
- #--- Create the NewsDir and configure !NewsBase
- #--- mirroring some of what a virgin Newsbase would do
- cli set temp <Internet$Dir>.!NewsDir
- copy <Internet$Dir>.!Newsbase.Support.newsbase.newsdir <temp>
- cli cdir <temp>.news
- cli cdir <temp>.newsbase
- cli cdir <temp>.newsbase.config
- translate <DemConfig$Res>.nbconfig <temp>.newsbase.config.nbconfig
- translate <DemConfig$Res>.users <temp>.newsbase.config.users
- cli cdir <temp>.newsbase.work
-
- #--- Create user details
- cli cdir <temp>.UserHome
- cli set temp2 <temp>.UserHome.{userid}
- cli cdir <temp2>
- translate <DemConfig$Res>.RLN <temp2>.RLN
- copy <temp2>.RLN <temp2>.Signature
- cli cdir <temp>.UserHome.default
- cli cdir <temp>.UserHome.postmaster
- cli cdir <temp>.UserHome.root
-
- #--- Set up welcome news/mail for delivery
- cli set temp <Internet$Dir>.!NewsDir.newsbase.work
- cli set temp2 <Internet$Dir>.!NewsBase.support.newsbase
- copy <temp2>.new_mail <temp>.postmaster
- copy <temp2>.new_news <temp>.localnews
-
- #--- Set up TTFN. Use a BASIC program to create the binary config file
- cli set temp <DemConfig$Dir>.temp
- cli set temp2 <Internet$Dir>.!TTFN
- set dest "<Internet$Dir>.!TTFN.Resources.!Config"
- translate <DemConfig$Res>.TTFNconfig <temp>
- cli basic -quit <temp>
- cli remove <temp>
-
- #--- Set up SLIPdial
- cli set temp <Internet$Dir>.!SLIPdial
- copy <DemConfig$Res>.SlipConfig <temp>.Resources.!Config
- translate <DemConfig$Res>.demconfg <temp>.Scripts.demconfg
-
- #--- Ensure all apps booted (may not be after unarchiving)
- cli run <Internet$Dir>.!TCPIP.!Boot
- cli run <Internet$Dir>.!TCPIPUser.!Boot
- cli run <Internet$Dir>.!NewsBase.!Boot
- cli run <Internet$Dir>.!NewsDir.!Boot
- cli run <Internet$Dir>.!TTFN.!Boot
- cli run <Internet$Dir>.!SerialDev.!Boot
- cli run <Internet$Dir>.!SLIPdial.!Boot
-
- confirm ok Configuration completed
- if {ok} = 0
- goto retry
- endif
-