9 Automating Things

Contents of this section

Now that you know how to get all your network services over TERM, it would be nice to set things up in such a way that your link is set up and configured automatically. There are basically an infinite number of ways of doing so, depending on what communication program you use and how you log in to your remote system.

One program that I have not used, but I have heard is quite nice, is fet: a front end for TERM. It is designed to log you into a remote system and fire up TERM and all your tredir's. Any comments on fet would be most welcome.

I shall now give an example of a set of commands that use kermit to log into the remote system and then performs all of the TERM initializations. Obviously, if you use these examples, you will have to modify them for your own login procedures.

The command which is actually invoked is the shell script 'knet', given by:

  #!/bin/sh
  /usr/bin/kermit -y $HOME/.kerm_term > $HOME/klog < /dev/null 2>& 1 
  exec $HOME/bin/tstart >> $HOME/klog 2>& 1

The script '.kerm_term' is given by:

 
  pause 2 
  # The number you want to dial 
  output atdtXXXXXXX \13 
  # Login to the terminal server 
  input 145 {name: } 
  output MYNAME \13 
  input 3 {word: } 
  output MYPASSWORD \13 
  input 5 {xyplex>} 
  # Make the line transparent 
  output term telnet-t \13 
  output term stopb 1 \13 
  # Connect to the remote host 
  output telnet remotehost.somedomain.org \13 
  input 10 {ogin: } 
  output MYOTHERNAME \13 
  input 3 word: 
  output MYOTHERPASSWORD \13 
  pause 5  
  # Fire up term on the remote host
  output exec term -s 38400 -l $HOME/tlog -w 10 -t 150  \13
  ! /usr/bin/term -r -l $HOME/tlog -s 38400 -c off -w 10 -t 150 < /dev/modem  > /dev/modem &
  # Open other clients here
  suspend 
  !killall -KILL term 

and finally, the script 'tstart' which fires up the TERM clients is given by

 
  #!/bin/sh 
  # 
  # This lets mail get out, can read news here, can pick up my mail here 
  # 
  /usr/local/bin/tredir 2025 25 2119 newshost:119 2110 pophost:110 
  # 
  # So I can open up Xwindows here 
  # 
  /usr/local/bin/trsh -s txconn 
  # 
  # So I will receive mail.... 
  # 
  /usr/local/bin/pop 
  # 
  # Clean out the queue, in case of boo-boos 
  # 
  /usr/bin/runq 
  # 
  # Done now 
  # 
  echo ^G^G > /dev/console 

When finally you want to close the connection, you resume and terminate kermit. The last line of the script kills the local TERM and returns the system in its initial state.

( Note of the author: instead of doing '!killall -KILL term', I think it should be possible just to do '!tshutdown'. This should also work?)

As I said, there are zillions of ways to do so; these are just meant as examples to get you started. Other examples can be found in the packages autoterm and JoelTermStuff.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter

Return to Welcome Home Page or Continue to Browse