.key DEBUG/S,PROVIDER/K,SCRIPT/K,BOOTPOPTIONS/F
.bra {
.ket }
;
; use profile made by Config AmiTCP by default
.def PROVIDER   "AmiTCP:db/Netsurf.conf"
; by default the dial script is the same as the provider file
.def SCRIPT     {PROVIDER}
;
; AmiTCP/IP DialUp 4.3 startnet script
;
; Copyright © 1996 AmiTCP/IP Group,
;                  NSDi - Network Solutions Development Inc., Finland
;                  All rights reserved.
;
; *NOTE*  YOU SHOULD NOT NEED TO EDIT ANYTHING BELOW. IF YOU NEED TO START
; *NOTE*  UTILITIES, DO IT IN THE AmiTCP:db/User-Startnet.
; *NOTE*  YOU CAN STOP THESE UTILITIES IN AmiTCP:db/User-Stopnet.
;
; Set the failat level so that the errors can be handled by the script
FailAt 21

If NOT Exists {PROVIDER}
  Echo AmiTCP/IP is not configured
  Echo Starting the configuration tool...
  Stack 20000   ; Installer needs this
  Run >nil: <nil: AmiTCP:bin/Installer SCRIPT "AmiTCP:Config AmiTCP" APPNAME AmiTCP/IP MINUSER AVERAGE
  Quit 20
EndIf

Version bsdsocket.library >nil:
If NOT Warn 
  Echo AmiTCP/IP is already running
  Echo Exiting...
  Quit 20
EndIf

If X EQ "X{DEBUG}"
  Run >nil: <nil: AmiTCP:AmiTCP {DEBUG}
Else
  Run AmiTCP:AmiTCP {DEBUG}
EndIf
WaitForPort AMITCP
If NOT Warn
  ; Log in with the default user name (ENV:LOGNAME)
  AmiTCP:bin/login -f
  ; Configure AmiTCP
  AmiTCP:bin/bootpconfig PROVIDERFILE={PROVIDER} DIALSCRIPT={SCRIPT} {DEBUG} {BOOTPOPTIONS}
  If NOT Warn
    ;
    ; Mount TCP:
    ;
    Assign TCP: Exists >NIL:
    IF Warn
      Mount TCP: from AmiTCP:devs/Inet-Mountlist
    EndIf
    ;
    ; Start utilities in AmiTCP:db/User-Startnet
    ;
    If Exists AmiTCP:db/User-Startnet
      Execute AmiTCP:db/User-Startnet
    EndIf
    ;
    ; Successfull end
; *** Run Online-o-meter if not already around ***
IF `rx "say show('P','OnlineREXX')"` EQ 0
   run <>nil: OnlineMeter LEFT=550 TOP=0
   WaitForPort OnlineREXX
ENDIF
; *** Set Zone ***
rx "address 'OnlineREXX'; setzone 'City'; setcomment 'Netsurf'"
    ;
; *** start Online-o-Meter timing ***
rx "address 'OnlineREXX' start 19"
    Echo AmiTCP/IP DialUp 4.3 is now on-line. Your host name is $HOSTNAME.
  Else
    Echo Interface {IFACE} configuration failed!
    Echo Stopping AmiTCP
    AmiTCP:bin/stopnet FLUSH NOUSER
  EndIf
Else
  Echo AmiTCP/IP DialUp couldn't be started!
EndIf

; EOF
