34 lines
455 B
Plaintext
34 lines
455 B
Plaintext
|
#!/bin/sh
|
||
|
#
|
||
|
# $FreeBSD$
|
||
|
#
|
||
|
# Example for chat.sh file.
|
||
|
|
||
|
INIT='at&f'
|
||
|
|
||
|
dial(){
|
||
|
/usr/bin/chat -v \
|
||
|
ABORT "ERROR" \
|
||
|
ABORT "NO DIALTONE" \
|
||
|
TIMEOUT 5 \
|
||
|
"" "AT" \
|
||
|
"OK" "${INIT}" \
|
||
|
"OK"-"+++"-"" "ATH" \
|
||
|
ABORT "BUSY" \
|
||
|
ABORT "NO ANSWER" \
|
||
|
ABORT "NO CARRIER" \
|
||
|
"OK" "ATDP$1" \
|
||
|
TIMEOUT 70 \
|
||
|
"ogin:" "username" \
|
||
|
"word:" "pasword" \
|
||
|
TIMEOUT 50 \
|
||
|
"PPP" "\c"
|
||
|
|
||
|
[ $? -eq 0 ] && exit 0
|
||
|
|
||
|
echo "$1 failed" 1>&2
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
dial 1234567
|