Metropoli BBS
VIEWER: autodial MODE: TEXT (ASCII)
#########   An autodialscript with dynamic IP assignment   ############
# IP, Gateway  and nameserver are captured and wattcp.cfg is modified.
# After this, the packetdriver is installed (slipper, no VJ Compression!)
# and the script returns control to the calling program 
$PORT=2f0                                  # Number of Comport (or Portadress)
$IRQ=5                                     # IRQ (only needed if Port is ADRESS)
$VEC=60                                    # Packetdriver vector
Phonenumber="atdp0721376822{13}"           # Dialupstring 
initstring="at&f{13}"                      # String to initialize our modem
redialtimeout=30                           # Wait before redial
Login=*****                                # Slip login 
Password=*****                             # and password
Packetdriver="slipper.exe port="+$port+" irq="+$IRQ+" vec="+$vec
opencom
if $CARRIER = OFF                         
   do 10                                    
      send initstring
      wait 2 OK{13,10}
      print "Dialing..."+Phonenumber
      print "Break with ESC..."  
      send Phonenumber
      wait 90 NO BUSY $CARRIER=ON            # wait for NO (Carrier),
      if $carrier=off                        # BUSY or CARRIER=ON
         hangup
         countdown=on                        # show the countdown    
         wait redialtimeout                  # wait a while...
         countdown=off
      end if
   while $CARRIER=OFF        # max. 10 attempts if CARRIER is off
   # wait for login
   wait 60 ">>>"             # wait for the signon message
   send s{13}                # send a response after signon
   wait 30 "login:"            # wait for 'login'...
   send login+{13}           
   wait 30 "Password:"         # and password
   send password+{13}
   wait 1                    # The next few lines should start
   send {13}                 # the slipserver on our unix machine
   wait 60 ">>>"             
   send {13}
   wait 10 ">>>"
   send {13}
   wait 60 login "-More-"    # Waiting for the prompt 
   if $0="-More-"            # Break Message screen 
      send " "
      wait 60 login
   end if
   wait  1
   send "ppl{13}"              # start PPL (Point to Point Link)
   print "{13,10}startup of PPL, be patient ... ;"
   countdown=on              # we have to wait some time if the server is busy
      wait 600 "Nameserver:" $CARRIER=OFF
   countdown=off
   if $carrier=Off           # If $carrier=off, someone terminated
      hangup                 # our call and you ar SOL :-(
      end
   end if
   # now we have to capture some IP'S from the Input-Stream 
   nameserver=$input 10      # capture IP of Nameserver 
   wait 60 "Linet="
   gateway=$input 10         # capture IP of Gateway
   wait 10 "Rinet="
   my_ip=$input 10           # capture our own IP
   wait 10 "SLIP"            # wait until server switches to SLIP
   # Replace all IP's in wattcp.cfg with the captured IP's
   modify "wattcp.cfg", "my_ip=", my_ip
   modify "wattcp.cfg", "gateway=", gateway
   modify "wattcp.cfg", "nameserver=", nameserver
end if
closecom
shell packetdriver 
ring 1                                     # call sysop
end                                        # THAT's IT
[ RETURN TO DIRECTORY ]