Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jan 1996 07:06:57 GMT
From: (Gestur A. Grjetarsson)
To: (Gestur A. Grjetarsson)
Subject:   Re: prevent paralell modem connection
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help
> Hello,
> I'd like to ask you,
> Could users on FreeBSD system hold two or more modem connections at
> same time, parallel logged on ?


> If so, is there a way to prevent people to be able to get connection on
> the system from two or more places at one time, like if users share their
> accounts, taking two modems and only paying for one account ?

Sure.  Stick a "cron" job in to count the number of times that a user is on
a tty line.  Think about something like:

#! /bin/sh -

PATH=/bin:/usr/bin; export PATH

who | grep " ttyd" | sort | uniq -c | (
	while read count user; do
		if [ ${count} -gt 1 ]; then
			kill -HUP `ps agxu | grep "^${user} " | awk '{print $2}'`

This is of course very simplistic but could be effective if run out of cron,
say, every 5 minutes (excuse any errors, I have NOT tested it, you shouldn't
run it unless you understand what it is doing and can fix my bugs)...

This is simpler than the network/X11 pty case, of course..  ;-)

> My system has limited amount of modems attached, so it would be of good
> appreaciation if I could manage to prevent parallel modem connections for
> one user.

... Joe

Joe Greco - Systems Administrator
Solaria Public Access UNIX - Milwaukee, WI			   414/342-4847

   Međ kveđju,

   Gestur A. Grjetarsson
   kerfisstjóri               sysadmin

         Islandia, Grensásvegur 7, 2h.t.h., 108 Reykjavik
            sími 5884020, modem 5884120, fax 5884014


     Programmers never die, they just GOSUB without RETURN !

Want to link to this message? Use this URL: <>