#########  script for manual login to the slipserver  ###########
# Variables are read from the x_tcp.cfg main configuration file
# If you want to make an autodialer of this script, edit the
# "login" sample file in the slip_it distribution and replace the 
# the "terminal" statement below by: call "login" 
$PORT = $entry x_tcp.cfg, "$PORT:"                                 
$IRQ = $entry x_tcp.cfg, "$IRQ:"            
$BAUD =$entry x_tcp.cfg,"$BAUD:"
$VEC = $entry wattcp.cfg, "pktint="            
initstring = $entry x_tcp.cfg, "initstring:"     
dialstring=  $entry x_tcp.cfg, "dialstring:"     
packetdriver = $entry x_tcp.cfg, "packetdriver:"
my_ip = $entry wattcp.cfg, "my_ip="        
maxwait = 0 
if $carrier = off
   autoquit=off
   dialstring = $inkey "Enter the dialstring or 'ESC' for manual dialup ("+dialstring+") ;"
   autoquit=on
   if dialstring>""
      send initstring+{13}
      wait 2 ok{13,10} 
      do
        send dialstring+{13}
        wait 120 $carrier=on BUSY NO
        if $CARRIER=OFF 
           wait 2 {10}  
           countdown=on
              print
              print "Redial Wait ...;"
              wait 30
           countdown=off
        end if
      while $carrier=off    
   end if
   print "The terminal will start now."
   print "QUIT WITH ALT-X IF YOU ARE LOGGED IN!"
   print "Hit any key ...;"
   ring 1                  # wake up ;-)
   # for automatic dialup, replace "terminal" by "call "login""
   # and delete print and $inkey statement.
   terminal                # start the terminal
endif
print"Hit ENTER if you want the default IP"
my_ip = $inkey "My_IP("+my_ip+")= ;"                
modify "wattcp.cfg", "my_ip=", my_ip
openslip packetdriver
ring 1
print "HIT CTRL-C IF YOUR SERVER DOESN'T RESPOND!"
end                                        # THAT's IT
