If the remote system is to be reached over a telephone line, the phone field specifies the number the modem should dial. It may contain several tokens interpreted by uucico 's dialing procedure. An equal sign (=) means wait for a secondary dial tone, and a dash (-) generates a one-second pause. Some telephone installations choke when you don't pause between dialing a special access code and the telephone number.[95]

It is often convenient to use names instead of numbers to describe area dialing codes. The dialcode file allows you to associate a name with a code that you may subsequently use when specifying telephone numbers for remote hosts. Suppose you have the following dialcode file:

# /usr/lib/uucp/dialcode - dialcode translation

Bogoham         024881

Coxton          035119

With these translations, you can use a phone number such as Bogoham7732 in the sys file, which will probably make things a little more legible and a whole lot easier to update should the dialing code for Bogoham ever change.

port and speed

The port and speed options are used to select the device used for calling the remote system and the maximum speed to which the device should be set.[96] A system entry may use either option alone or both options in conjunction. When looking up a suitable device in the port file, only ports that have a matching port name and/or speed range are selected.

Generally, using the speed option only should suffice. If you have only one serial device defined in port, uucico always picks the right one anyway, so you only have to give it the desired speed. If you have several modems attached to your systems, you still often don't want to name a particular port, because if uucico finds that there are several matches, it tries each device in turn until it finds an unused one.

The login chat

We already encountered the login chat script, which tells uucico how to log in to the remote system. It consists of a list of tokens specifying strings expected and sent by the local uucico process. uucico waits until the remote machine sends a login prompt, then returns the login name, waits for the remote system to send the password prompt, and sends the password. Expect and send strings appear in alternation in the script. uucico automatically appends a carriage return character ( ) to any send string. Thus, a simple chat script would look like:

ogin: vstout ssword: catch22

You will probably notice that the expect fields don't contain the whole prompts. This ensures that the login succeeds, even if the remote system transmits Login: instead of login:. If the string you are expecting or sending contains spaces or other white-space characters, you must use quotes to surround the text.

uucico also allows for some sort of conditional execution. Let's say the remote machine's getty needs to be reset before sending a prompt. For this, you can attach a subchat to an expect string, set off by a dash. The subchat is executed only if the main expect fails, i.e., a timeout occurs. One way to use this feature is to send a BREAK if the remote site doesn't display a login prompt. The following example gives a general-purpose chat script that should also work in case you have to press Enter before the login appears. The empty first argument, ', tells UUCP to not wait for anything, but to continue with the next send string:

'' d c ogin:-BREAK-ogin: vstout ssword: catch22

A couple of special strings and escape characters can occur in the chat script. The following is a partial list of characters legal in expect strings:

''

The empty string. It tells uucico to not wait for anything, but to proceed with the next send string immediately.

Tab character.

Carriage return character.

s

Space character. You need this to embed spaces in a chat string.

Newline character.

\

Backslash character.

On send strings, the following escape characters and strings are legal in addition to the above:

EOT

End of transmission character (^D).

BREAK

Break character.

c

Suppress sending of carriage return at end of string.

d

Delay sending for 1 second.

E

Enable echo checking. This requires uucico to wait for the echo of everything it writes to be read back from the device before it can continue with the chat. It is primarily useful when used in modem chats (which we will encounter later). Echo checking is off by default.

e

Disable echo checking.

K

Same as BREAK.

p

Pause for fraction of a second.

Alternates

Sometimes you want to have multiple entries for a single system, for instance if the system can be reached on different modem lines. With Taylor UUCP, you can do this by defining a so-called alternate.

An alternate entry retains all settings from the main system entry and specifies only those values that should be overridden in the default system entry or added to it. An alternate is offset from the system entry by a line containing the keyword alternate.

To use two phone numbers for pablo, you would modify its

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату