# Automating Things

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 haven't used, but I've 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'll 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
    # Suspend kermit
    !killall -STOP kermit

and finally, the script `tstart` which fires up the local `term` and its clients is given by

    #!/bin/sh
    #
    # Fire up term
    #
    /usr/local/bin/term -l $HOME/tlog -s 38400 -r -w 10 -t 150 < /dev/modem > /dev/modem &
    #
    # Let it get going
    #
    sleep 3
    #
    # 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

As I said, there are zillions of ways to do this, these are just meant as examples to get you started.