From owner-freebsd-questions Thu Jun 29 15:39:21 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 19D9E37B834 for ; Thu, 29 Jun 2000 15:39:15 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e5TMdDO21091; Thu, 29 Jun 2000 15:39:13 -0700 (PDT) Date: Thu, 29 Jun 2000 15:39:13 -0700 From: Alfred Perlstein To: craig.massey@iname.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: A quota system for modem time accessed from a '98 PC Message-ID: <20000629153913.Z275@fw.wintelcom.net> References: <000629182541BE.18742@weba2.iname.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <000629182541BE.18742@weba2.iname.net>; from craig.massey@iname.com on Thu, Jun 29, 2000 at 06:25:41PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * craig.massey@iname.com [000629 15:26] wrote: > My somewhat inactive teenage step-son accesses the web from his > '98 PC through our FreeBSD server. I'd like to be able to put limits > on his surfing hours per month/week/day linked to the amount he > contributes to the household chores. > > I can think of several ways to do this which all involve some > scripting on my part. Paradoxically, I know Perl on NT quite well, > but have never used it on a Unix OS, so I'd have some work to do. > > Is there an established way of achieving a quota on modem time? > If not I'll have to roll up my sleeves and get inventive. I think an inventive trick would be to use cron to every 5 minutes check an IPFW counter you setup to watch his machine's bandwidth usage. Reset the counter every 5 minutes, and if it's non-zero (or maybe above several KB) then "charge" him for the time. You could store this in a simple data file and when the time limit is exceeded then simply set a rule to completely block, at midnight just run a script to remove the initial rule and reset the accounting file. > ps I'm going to encourage him to circumvent any system I put in > place. Hacking his way past it will force him to learn something > and that's even better than getting help with the housework. heh heh heh... best of luck. :) try to wrap lines at 70 characters, makes it easier for us to read. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message