デフォルトの CHAT スクリプトでは、2 つの Solaris システム間でリンクを確立すると仮定します。Solaris 以外のオペレーティングシステムを使用しているマシンと接続するには、ログインダイアログを変更する必要がある場合があります。
たとえば、PPP を実装している OpenVMS システムと接続するには、以下のように接続スクリプトを変更します。
send RETURN # Change "ogin:" to "name:" for OpenVMS expect "name:" 10 onerror send BREAK repeat 3 send "ppp" expect "word:" 40 # # Set the ppp password of the remote host here # send "xxxxx" |
CHAT テンプレートスクリプトは、単純な方法によってリモートホストにログインします。CHAT スクリプトを変更し拡張して、より複雑なログインダイアログを作成することができます。ただし、Solstice PPP を実装するリモートホストへの接続を開始するには、リモートホストが認識するログイン識別子を定義し、Solstice PPP ログインサービスを起動する手段を用意する必要があります。
次に示す CHAT スクリプト例は、Solaris 環境を実装するリモートホストにログインし、動作が正常終了したことを示す電子メールメッセージを mailx(1) を起動して送信し、Solstice PPP ログインサービスを起動します。この場合は、スクリプトが送信するログイン識別子に該当するリモートホスト上のユーザーアカウントは、デフォルトシェルとして /usr/bin/csh を使用する必要があります。
# Chat script to invoke mailx on remote # # Set the line regarding the remote site configuration # Due to UUCP limitations some systems only accept cs7 # setline cs7 parodd # Start dialog with the remote host send RETURN # Set expected response, retry 3 times at 10 second intervals expect "ogin:" 10 onerror send BREAK repeat 3 # Set login id (mylogin) sent to remote host send "mylogin" # Set response expected from remote host, wait up to 40 seconds expect "word: " 40 # # Set the login password (my passwd) of the remote host send "mypasswd" # Set response expected from remote host (C-shell prompt) expect "%" # Set command sent to invoke mailx send "echo Login to remote successful | /usr/bin/mailx alias" # Set response expected from remote host (C-shell prompt) expect "%" # Start PPP login service (pppls) on remote send "/usr/sbin/pppls" |
以下の CHAT スクリプトは、telnet ターミナルサーバーへのログインを行います。
# Chat script to login to telnet server # # Set the line regarding the remote site configuration # Due to UUCP limitations some systems only accept cs7 # setline cs7 parodd send RETURN expect "sername:" 10 onerror send RETURN repeat 5 send "your_username" expect "assword:" 35 send "your_password" expect "pc>" 10 onerror send RETURN repeat 2 send "terminal flowcontrol hardware" expect "pc>" 10 onerror send RETURN repeat 2 send "terminal databits 8" expect "pc>" 10 onerror send RETURN repeat 2 send "terminal parity none" expect "pc>" 10 onerror send RETURN repeat 2 send "terminal escape-character 0" expect "pc>" 10 onerror send RETURN repeat 2 send "terminal telnet-transparent" expect "pc>" 10 onerror send RETURN repeat 2 send "telnet your_own_machine" expect "ogin:" onerror send RETURN repeat 5 send "your_login_for_PPP" expect "assword:" 35 send "your_password _for_PPP" |