Automating Things

# 7 Automating Things

Contents of this section

Now that you know how to get all of your network services over `term`, it would be nice to set things up so your link is set up and configured automatically. There are basically an infinite number of ways of doing this, depending on what comm 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 this, these are just meant as examples to get you started.

Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter