# /etc/slip.dip # Author : Peter Tobias # Version : 1.1 # Return codes: # 0 - ok # 5 - non serious problem (they won't cost you money) # 10 - serious problem # Predefined error levels: # 0 - OK 1 - CONNECT 2 - ERROR 3 - BUSY 4 - NO CARRIER # Assign the error level 5 to the modem string "NO DIALTONE" chatkey NO\sDIALTONE 5 main: print Initializing networking parameters ... print Initializing serial port and modem ... print get $retries 0 port cua0 if $errlvl != 0 goto bad_tty speed 38400 reset init ATZ redial: # Set max. retries if $retries == 50 goto busy_end inc $retries print [ $retries ] Dialing to $remote [ $rmtip ] dial T1-215-966-7777 if $errlvl == 3 goto busy if $errlvl == 4 goto no_carrier if $errlvl == 5 goto no_dialtone if $errlvl != 1 goto error login: wait do? 20 if $errlvl != 0 goto login_err send slip\n wait name: 10 if $errlvl != 0 goto login_err send YOUR_LOGIN_NAME_GOES_HERE\n wait ord: 5 if $errlvl != 0 goto passwd_err send YOUR_PASSWORD_GOES_HERE\n get $rmtip remote 10 if $errlvl != 0 goto no_ip_address get $locip remote 10 if $errlvl != 0 goto no_ip_address # get $mtu 576 default print CONNECTED to $remote with address $local mode CSLIP goto exit busy: print [ $retries ] Dialing failed (BUSY), repeating after delay (2 sec)... print sleep 2 goto redial busy_end: print The SLIP line is still busy. Try again later ... goto exit_warn bad_tty: print Can't open TTY line ... goto exit_error login_err: print Error sending login name goto exit_error passwd_err: print Error sending password goto exit_error no_carrier: print Dialing failed (NO CARRIER) goto exit_error no_ip_address: print Can't get (local) IP address from $remote goto exit_error no_slip: print Protocol not supported on remote host? goto exit_error no_dialtone: print Dialing failed (NO DIALTONE) goto exit_warn error: print SLIP to $remote [ $rmtip ] failed exit_error: exit 10 exit_warn: exit 5 exit: