Re: getty replacement

From: Daniel O'Connor <doconnor_at_gsoft.com.au>
Date: Tue, 5 Jul 2005 22:15:00 +0930
On Tue, 5 Jul 2005 20:15, Marcin Jessa wrote:
> That unfortunatelly does not seem to work.
> I tried a shell script with a read -p "Blah blah"  my_choice
> which should wait for an execution but this did not work either giving me
> exactly the same message... _______________________________________________

I believe your getty program has to open the tty that init passed it.

I suspect stdin is redirected to /dev/null by init for your program so the 
read exits.

I just tried this and it works fine..

#!/bin/sh

logger "Got these args $*"
while [ $# -gt 1 ]; do
  if [ -z "$args" ]; then
    args=$1
  else
    args="$args $1"
  fi
  shift
done
tty=$1

logger "tty is $tty"
logger "other args are $args"
echo "Hello there" >/dev/$tty

sleep 600

Note that the TTY name is last in the argument list.


-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Received on Tue Jul 05 2005 - 10:45:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:38 UTC