Find the answer to your Linux question:
Results 1 to 3 of 3
I'm in a bit of trouble right now. I have a project due for my class (linux/unix 101 stuff) and it involves scripting. I'm horrible at it and don't know ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Login script...Need help asap

    I'm in a bit of trouble right now. I have a project due for my class (linux/unix 101 stuff) and it involves scripting. I'm horrible at it and don't know what to do.

    Ok to start off i have a project that has to deal with creating a company with 17 different users and making a file/directory system. Also i have to create a shell script with a login screen and a menu with submenus.

    I'm currently stuck on how to create the login screen from reading the users from the folder i put the users in. Then i don't know how to make it so when they put their user name and password in, it goes from the login screen to the "main menu" that i had made after they have a successful login.

    Here are my codes right now.

    This is my login screen.
    Code:
    tput cup $1 $2
    tput clear
    bold=`tput smso`
    offbold=`tput rmso`
    echo $bold
    tput cup 10 20; echo "User ID:"
    tput cup 12 20; echo "Password:"
    echo $offbold
    tput cup 10 41; read userid
    tput cup 12 41; read password
    here is my main menu screen:
    Code:
     while :
     do
        clear
        echo "-------------------------------------"
        echo " Main Menu "
        echo "-------------------------------------"
        echo "[1] Customer Information"
        echo "[2] Employee Information"
        echo "[3] Search"
        echo "[4] User settings"
        echo "[6] Exit"
        echo "======================="
        echo -n "Enter your choice [1-5]: "
        read yourch
        case $yourch in
          1) echo "Taking you to customer infomation...Please wait." ; read ;;
          2) echo "Taking you to employee infromation...Please wait." ; read ;;
          3) echo "Taking you to search." ; read ;;
          4) echo "User settings." ; read ;;
          5) exit 0; ;;
          *) echo "Please select choice 1,2,3,4, or 5";
             echo "Press a key. . ." ; read ;;
     esac
    done
    Now i don't know where to go from there. I want to "join" the 2 files so that once the users login's with the correct password and user name they can see the menu screen. The last parts on the menu screen i just put there until i find a way to make the choice selection go from when you press 1 or 2 or 3 to another script that has the information on it.

    If anyone can help me with this that would be great. I would like to get this done asap.
    Also i'm having some problems with the users. If anyone has any better way to configure a users group to join in with the scripts please let me know.

    Thanks

  2. #2
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    You might want to look into using dialog for the menus.

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3
    what do you mean dialog?

    oh and i found out how to configure it so that i can make it go to the next script.

    but now my real trouble is to get it so that a users has to login to access this stuff and if the user doesn't log in with the correct password and name it comes up with a thing saying incorrect user/password please try again and refreshes that screen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...