From owner-freebsd-questions Wed Mar 12 10:17:12 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFE1837B404 for ; Wed, 12 Mar 2003 10:17:08 -0800 (PST) Received: from bran.mc.mpls.visi.com (bran.mc.mpls.visi.com [208.42.156.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id A591743FBD for ; Wed, 12 Mar 2003 10:17:07 -0800 (PST) (envelope-from hawkeyd@visi.com) Received: from sheol.localdomain (hawkeyd-fw.dsl.visi.com [208.42.101.193]) by bran.mc.mpls.visi.com (Postfix) with ESMTP id C6361504D; Wed, 12 Mar 2003 12:17:06 -0600 (CST) Received: (from hawkeyd@localhost) by sheol.localdomain (8.11.6/8.11.6) id h2CIH6j06127; Wed, 12 Mar 2003 12:17:06 -0600 (CST) (envelope-from hawkeyd) Date: Wed, 12 Mar 2003 12:17:06 -0600 From: D J Hawkey Jr To: Dan Langille Cc: freebsd-questions@FreeBSD.ORG Subject: Re: FreeBSD for Mom Message-ID: <20030312121706.A5989@sheol.localdomain> Reply-To: hawkeyd@visi.com References: <3E6F2EA7.8164.53EAFA7@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3E6F2EA7.8164.53EAFA7@localhost>; from dan@langille.org on Wed, Mar 12, 2003 at 12:57:11PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mar 12, at 12:57 PM, Dan Langille wrote: > > My mom uses FreeBSD. More precisely, she uses Pine to send/receive > email. At present, she has a DSL connection. She's soon to change > to a dial up account. > > What I'm planning to do is provide her with a shell script which will > send/receive email for her. She'll run it to check for mail and when > she's done composing her outgoing mail. > > My initial untested idea is: > > - ppp --dial HerISP, > - wait for the connection to come up I can get you this far. > - kill the connection This one, too. See the attached script. Note that I had to hack some files in /etc/ppp to get things to work right (auto-dialup when anything WAN-related happens). If you want these too, I can supply them, but I have to wonder if the list is the right forum? I used kernel-mode PPP, BTW. > Cheers > -- > Dan Langille : http://www.langille.org/ Dave -- Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?" --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Description: EZ shell interface to pppctl Content-Disposition: attachment; filename=pppc #!/bin/sh # # EZ interface to pppctl. Supports connecting, disconnecting, setting the # timeout value, showing the bundle, and testing the line (the last returns # 0 if line up, the others return undefined). # for cron PATH=$PATH:/usr/sbin # defined in /etc/ppp/ppp.conf COMMCHNL=/var/run/ppp TIMEOUT=180 NOISY=-v test_up () { pppctl -v $COMMCHNL quit 2>/dev/null |grep ^PPP >/dev/null return $? } syntax () { echo "usage: "${0##*/}" -c|-d|-s|-v [-t timeout] [-q]" echo " -c, -d, and -t always set a timeout (default="$TIMEOUT")" exit } if [ $# -eq 0 ]; then syntax fi while getopts "cdqst:v" OPT; do case $OPT in c) FLAG=c;; d) FLAG=d;; q) NOISY=;; s) FLAG=s;; t) TIME=$OPTARG;; v) FLAG=v;; *) syntax;; esac done if [ "$TIME" -o "$FLAG" -a "$FLAG" != "v" -a "$FLAG" != "s" ]; then if [ "$TIME" ]; then TIMEOUT=$TIME fi pppctl $NOISY $COMMCHNL set timeout $TIMEOUT fi case $FLAG in c) test_up; if [ $? -eq 0 ]; then if [ "$NOISY" ]; then echo "Line is up" fi exit fi; exec pppctl $NOISY $COMMCHNL dial;; d) exec pppctl $NOISY $COMMCHNL close;; s) exec pppctl $NOISY $COMMCHNL show bundle;; v) test_up; RETVAL=$?; if [ "$NOISY" ]; then if [ $RETVAL -eq 0 ]; then echo "Line is up" else echo "Line is down" fi fi; exit $RETVAL;; esac --FCuugMFkClbJLl1L-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message