next up previous contents
Next: A dip Reference Up: Using dip Previous: Using dip

A Sample Script


Figure:   A sample dip script

A sample script is produced in figure gif. It can be used to connect to cowslip by invoking dip with the script name as argument:

After connecting to cowslip and enabling SLIP, dip will detach from the terminal and go to the background. You can then start using the normal networking services on the SLIP link. To terminate the connection, simply invoke dip with the -k option. This sends a hangup signal to dip process, using the process id dip records in /etc/

In dip's scripting language, keywords prefixed with a dollar symbol denote variable names. dip has a predefined set of variables which will be listed below. $remote and $local, for instance, contain the hostnames of the local and remote host involved in the SLIP link.

The first two statements in the sample script are get commands, which is dip's way to set a variable. Here, the local and remote hostname are set to vlager and cowslip, respectively.

  The next five statements set up the terminal line and the modem. The reset sends a reset string to the modem; for Hayes-compatible modems, this is the ATZ command. The next statement flushes out the modem response, so that the login chat in the next few lines will work properly. This chat is pretty straight-forward: it simply dials 41988, the phone number of cowslip, and logs into the account Svlager using the password hey-jude. The wait command makes dip wait for the string given as its first argument; the number given as second argument make the wait time out after that many seconds if no such string is received. The if commands interspersed in the login procedure check that no error has occurred while executing the command.

The final commands executed after logging in are default, which makes the SLIP link the default route to all hosts, and mode, which enables SLIP mode on the line and configures the interface and routing table for you.

next up previous contents
Next: A dip Reference Up: Using dip Previous: Using dip

Andrew Anderson
Thu Mar 7 23:22:06 EST 1996