From owner-freebsd-questions Fri Apr 17 15:09:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA14387 for freebsd-questions-outgoing; Fri, 17 Apr 1998 15:09:44 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA14245 for ; Fri, 17 Apr 1998 22:09:19 GMT (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.8) with SMTP id PAA01760; Fri, 17 Apr 1998 15:09:00 -0700 (PDT) (envelope-from dwhite@gdi.uoregon.edu) Date: Fri, 17 Apr 1998 15:09:00 -0700 (PDT) From: Doug White Reply-To: Doug White To: George Vagner cc: questions@FreeBSD.ORG Subject: Re: bad modem on isp In-Reply-To: <199804171322.IAA02816@mutsgo.dyn.ml.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 17 Apr 1998, George Vagner wrote: > i wrote to you a few days ago about losing connection > where i can ping anywhere but cant ftp,http,telnet etc > anywhere. it happened again today so what i did > was just disconnected my modem phone line until it lost carrier > and the system redialed as uasual and all was great again. Hm, ok. > i have come to the conclusion that there may be a bad modem > on my providers system and i just happen to dial into this > modem once in a while and get stuck on it cause it dont hang up > it just sits there where other modems hang up after a > random amount of time ~ 1 hour or so. Odd. > so here is what i want to do... > > can you suggest a small program or script that i can enter > into cron so it will request a http page or something > and if it fails to return the page then hang up the modem > and redial or kill ppp and restart it (same result)?? Sure, easy, you could use fetch to grab a web page and check it's return code. If it gets an error or times out it will probably return a code >0 (have to check the manpage). So something like this: #!/bin/sh fetch http://your-isps-site.com/ || kill-ppp-command > i am keeping a log of all the ip's i connect as so to > inform the provider of the malfunctioning modem line. The times are really important. When you have a bank of 100 modems it's virtually impossible to find bad modems without some seriously detailed data. Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message