turn off modem during the day

"Paul M. Sittler" (psittler@behemoth.tamu.edu)
Wed, 24 Sep 1997 20:27:32 +0200


On Wed, 24 Sep 1997, Mate Wierdl wrote:

> I have my modem in my office set up for dialin via mgetty
> (Linux Redhat 4.1, mgetty mgetty-1.0.0). 
> 
> The University has a voicemail system which I would like to use
> while I am in the office, otherwise I 'd like mgetty and the
> modem answer the phone when I leave. 
> 
> Can I do this simply without playing with the mgetty entry in
> inittab and rebooting (or init q). What if I just simply turn
> the modem off while I am in the office? Would mgetty get
> confused after a while, or it will just report to the log file
> that the modem is off, and it will get back to business as soon
> as the modem is turned on? 

My memory may be somewhat faulty, especially about correct file
names. . .

mgetty has a provision that looks for a "nologin.<DEVICE>" file in
the /etc directory. If that file exists, it will not answer the
line. If it does not exist, it will.

You may schedule the creation of such files using cron to touch
the files or delete them at the appropriate times.

snip from mgetty.info-1
================================================================

Denying logins
==============

 If you want to prevent mgetty from accepting calls, you can do
so by creating a file called `/etc/nologin.<DEVICE>' (e.g. 
`/etc/nologin.tty2a'). If mgetty detects an incoming call, and
sees this file, it will *NOT* answer the phone. This way the
caller does not lose money for a useless call when logins are not
allowed anyway. (You can change the filename that is checked by
changing `NOLOGIN_FILE' in `policy.h') 

 This can be used for quite sophisticated scheduling purposes -
imagine a modem attached to a line used for voice during the
daytime. So, you want the modem only to answer the phone during
9 pm and 7 am. What you do is to have `cron' create a
`/etc/nologin.DEVICE' file at 7 am (so the modem won't answer the
call during the day) and remove it at 9 pm (so the modem can
answer the phone at night). 

=================================================================

> Thanks,
> 
> Mate
> 
> Mate Wierdl 
> mw@moni.msci.memphis.edu 
> University of Memphis

And now, for a little bit of the wisdom of the ages. . .

 "We trained hard, but it seemed that every time we were
  beginning to form up into teams, we would be reorganized.
  I was to learn later in life, that we tend to meet any new
  situation by reorganizing, and what a wonderful method it
  can be for creating the illusion of progress, while only
  producing confusion, inefficiency, and demoralization."

  --- Petronius Gaius (The Arbiter) 60 A.D. ---

-------
Paul M. Sittler (root) | / / (_)__ __ ____ __ | The choice
Leviathan System Admin | / /__/ / _ \/ // /\ \/ / | of a GNU
email: p-sittler@tamu.edu | /____/_/_//_/\_,_/ /_/\_\ | Generation
Pager: 409 759-1258  A 486 is a terrible thing to waste...

.