#!/bin/sh# script for pppMAX_WAIT=45DEVICE=ppp0#---------------------address(){  ip=`/sbin/ifconfig | grep 'P-t-P' | sed 's/.*inet addr:\(.*\)  P-t-P.*/\1/'`}#---------------------go(){  if [ -r /var/run/$DEVICE.pid ]  then    # pppd is running, bring it down    stop  else#     pppd is not running, bring it up#     change the *'s in the following line to your login name#     and the *'s in the line after that to your local access number      /usr/sbin/pppd name "********" -d connect \      '/usr/sbin/chat -t 45 ABORT BUSY "" ATDT******* CONNECT ""' \      /dev/modem 57600 noipdefault modem defaultroute crtscts    i=$MAX_WAIT    while [ 0 -eq 0 ]    do      address      if [ -n "$ip" ]      then	break      fi      if [ "$i" -eq 0 ]      then	break      fi      i=`expr $i - 1`      sleep 1    done  fi}#---------------------stop(){# 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    fifi}#---------------------case "$1" in  start|on)    start    ;;  stop|off)    stop    ;;  status)    if [ -r /var/run/$DEVICE.pid ]    then      echo "pppd running"    else      echo "pppd not running"    fi    ;;  address|number)    address    if [ $ip ]    then      echo "$ip"    fi    ;;  restart)    stop    sleep 5    start    ;;# default  *)     go     exit 0esacexit 0