@echo off
rem Freeware Dialer Package for use with Wattcp ftp  
rem Change the server name . This is a manual ftp with unix commands
rem for the purists.
cls


setscrn
echo.
echo             ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo             º          Dialup FTP          º
echo             ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
echo.

echo.
echo          Automated Session starting
echo.
echo          Dialing ....
echo.

:DIAL
rem dial up the ISP
NETDIAL BASE 0xMYBASE IRQ MYIRQ MYSPEED
rem        :    :
rem        :  speed - must be the same for this line and the packet driver.
rem        :
rem      comport - must be the same for both
rem                netdial lines and the packet driver lines ( hangup too) 
            
IF ERRORLEVEL 1 GOTO BUSY
goto PKTDRVR

:BUSY
setscrn
echo.
echo             ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo             º        FTP Re-Dialer         º
echo             ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼
echo.
	echo No Response.. will redial automatically ...Esc to quit
	echo.
	Holdit  20 > nul
	if errorlevel 200 goto END
	if errorlevel 0 goto DIAL
	setscrn
	goto DIAL

:PKTDRVR
rem logged in, so start the Packet driver 
epppd base 0xMYBASE irq MYIRQ pktvec 0xMYVEC MYSPEED asyncmap 0 crtscts
call IP-UP.bat
echo my_ip=%MYIP% > path.cfg
echo gateway=%remip% >> path.cfg
echo netmask=%netmask% >> path.cfg
echo nameserver=MYDNS1 >> path.cfg
:MYREM  echo nameserver=MYDNS2 >> path.cfg
echo Ip address set to %MYIP%

rem ALTERNATE PACKET DRIVERS
rem slipper base MYBASE irq MYIRQ vec=MYVEC speed=MYSPEED
rem          :     :        :
rem       comport  :      speed
rem                :
rem             vector - must be the same for the termin line
rem cslipper base MYBASE irq MYIRQ vec=MYVEC speed=MYSPEED
if errorlevel 1 goto END

rem if using slip/cslip and server does not have bootp use the following
rem and get ipread from the zip directory in ipcfg010.zip
rem IPread "IP address " > IP-UP.bat
rem call IP-UP.bat
rem if errorlevel 1 goto END 

:MT
cd .\FTP
ftp oak.oakland.edu

:END
rem  remove the packet driver and hang up the phone

rem change back to the  Dialer directory
cd ..

termin 0xMYVEC 
rem      :
rem    vector should be same as used when loading Packet driver 

netdial BASE 0xMYBASE IRQ MYIRQ hangup
rem        :
rem     comport should be the same as 2 other places in batch file
