#!/bin/sh # /usr/local/bin/bash_login # # see /etc/bashrc for a complete description how all bash source files # are related and used on this box # # this script is sourced by each user's ~/.bash_login source /etc/functions-system source /etc/functions-colors # `who -r` returns: run-level 4 Nov 5 07:29 last=S # 20th character is the run-level RL=`who -r` # ${VARIABLE:Offset:Count} RL=${RL:19:1} if [ "$RL" != "4" ] ; then # not run-level 4 # provide a simple hello to the user echo -e "${BOLDBLUE}" date echo -e "${BOLDYELLOW}Hello `whoami`!${COLOR_RESET}" echo fi # do not run the following routine from init 4, otherwise the GUI login manager will hang if [ "$RL" = "3" ] ; then # in run-level 3 # do not run this routine from an X-based terminal if [ "$TERM" = "xterm" ] ; then # we are inside an X session so let's quit exit 1 else # let's help users start X Wait_For_Response "Do you want to start the X graphical environment?" if [ "$response" = "y" ] || [ "$response" = "Y" ] ; then /usr/X11R6/bin/startx else # remind users how to start X manually or to modify their GUI echo echo -e "Type ${BOLDGREEN}startx${COLOR_RESET} to start the X graphical environment." echo -e "Type ${BOLDWHITE}xwmconfig${COLOR_RESET} to change your user X graphical environment." echo fi unset allowedchars unset response fi fi unset RL