dip -k' は使えますか? いいえ、`dip -k' は使えません
chat のディレクトリの中に `ppp-off'というスクリプトがあり、こ
のスクリプトが `dip -k' 同様に ppp 接続の終了に使えます。
このスクリプトは以下の通りです(切り出して、適切な名前にセーブし、chmod を使って実行可能にしてください)
#!/bin/sh
DEVICE=ppp0
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
if [ ! "$?" = "0" ]; then
rm -f /var/run/$DEVICE.pid
echo "ERROR: Removed stale pid file"
exit 1
fi
#
# Success. Let pppd clean up its own junk.
echo "PPP link to $DEVICE terminated."
exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1
これにはいくつかの理由が考えられます。
modem' パラメーターを渡していますか?
このパラメータを指定することで pppd に制御しているものがモデ
ムであると認識させ、モデムの状況を知らせる信号を解釈できるようになりま
す。このパラメータについての詳細は pppd の man ページをご覧く
ださい。
DTR 信号はコンピュータから送られ、モデムに接続断を指令します。 Hayes 系のモデムでは、DTR を認識するためには "&D1" か "&D2" をいうコ マンドを送る必要があります。PPP の設定には "&:D2" の方が望ましいで しょう。多くのモデムでは、"工場出荷時の設定"のままでは DTR を認識しない 設定になっています。
`シェル'として実行すべきスクリプトはこのようなものです。
#!/bin/sh exec pppd -detach modem ...