From owner-freebsd-questions Sat Sep 21 08:48:40 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA29929 for questions-outgoing; Sat, 21 Sep 1996 08:48:40 -0700 (PDT) Received: from agora.rdrop.com (root@agora.rdrop.com [199.2.210.241]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA29904 for ; Sat, 21 Sep 1996 08:48:36 -0700 (PDT) Received: from synwork.com by agora.rdrop.com with smtp (Smail3.1.29.1 #17) id m0v4UID-0008ueC; Sat, 21 Sep 96 08:48 PDT Received: from localhost (flaq@localhost) by synwork.com (8.7.5/8.6.12) with SMTP id KAA00694 for ; Sat, 21 Sep 1996 10:41:13 -0500 (CDT) Date: Sat, 21 Sep 1996 10:41:12 -0500 (CDT) From: Mike To: questions@freebsd.org Subject: Help with PPP Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I am running the following script from cron to verify my PPP connection and if necessary, reestablish it. The script works fine except when ppp is invoked from the script, it is a CPU hog! Any suggestions on fixing this? #!/bin/sh PATH=/sbin:/usr/sbin:/bin:/usr/bin ipaddr="199.3.232.12" # which ip address to check for basic connectivity ppptag="simplesite" # which tag in ppp.conf to use to redial pppline=`ps -axu | grep "[p][p][p][) ]"` if [ ! -z "$pppline" ] ; then if ping -c 10 $ipaddr 2> /dev/null | grep -q "100% packet loss" ; then ppppid=`echo $pppline | awk '{print $2}'` kill $ppppid sleep 3 ppp $ppptag & fi else ppp $ppptag & fi Partial output of 'top' ------------------------- load averages: 1.46, 0.67, 0.33 10:38:21 48 processes: 2 running, 45 sleeping, 1 zombie Cpu states: 20.5% user, 0.0% nice, 78.7% system, 0.8% interrupt, 0.0% idle Memory: 24M Active, 3300K Inact, 5240K Wired, 14M Cache, 364K Free Swap: 77M Total, 77M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 600 root 94 0 456K 660K run 3:06 89.04% 89.04% ppp ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~ Syn-Work Media, Inc. | WWW Development & Hosting | Life Safety http://www.synwork.com | Systems Integration | CCTV mike@synwork.com | Voice/Data/Fiber | Access Control Flaq on IRC | Dukane Distributor | BICSI/RCDD :|:|:|: Powered By FreeBSD :|:|:|: Turning PC's Into Workstations ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~