# Falls login an folgenden Terminals sofort Weiterleitung zu:
TTY8_HOST=energija
TTY8_ALT=buran
TTY9_HOST=energija
TTY9_ALT=buran
TTY10_HOST=energija
TTY10_ALT=buran
TTY11_HOST=buran
TTY11_ALT=energija
TTY12_HOST=buran
TTY12_ALT=energija

LOGIN_TTY=`tty | sed "s/\/dev\///"`

login_host () {
     echo "Weiterleitung zu $1"
     if (/usr/local/share/whereami/hostalive $1) ; then 
       slogin `/usr/local/share/whereami/userathost $1` $1 && exit
     else
       echo "Versuche Weiterleitung zu $2 ..."
       if [ $2 ] ; then
         if (/usr/local/share/whereami/hostalive $2) ; then 
           slogin `/usr/local/share/whereami/userathost $2` $2 && exit
         fi
       fi

     fi
}

case "$LOGIN_TTY" in
  tty8)
     login_host $TTY8_HOST $TTY8_ALT
     ;;
  tty9)
     login_host $TTY9_HOST $TTY9_ALT
     ;;
  tty10)
     login_host $TTY10_HOST $TTY10_ALT
     ;;
  tty11)
     login_host $TTY11_HOST $TTY11_ALT
     ;;
  tty12)
     login_host $TTY12_HOST $TTY12_ALT
     ;;
esac
	      								
if [ -f /etc/local/profile.common ]; then 
  . /etc/local/profile.common
fi

#  Piepston noch dumpfer und kürzer machen
if [ "$TERM" != "" ] ; then
   #setterm -bfreq 50  # does not work any more
   setterm -blength 50
fi

