Simple Login script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Simple Login script
# 8  
Old 11-11-2014
So its working now?

You should also add in case a quit option... (my 2 pennies...)
# 9  
Old 11-11-2014
No vbe not working, whatever i put in as login it exits.Smilie
# 10  
Old 11-11-2014
Code:
login=abc
echo "Please Login . ." 
read loginpass 
               if [ "$loginpass" = "login" ]

What do you enter for loginpass? While having assigned "abc" to the variable login, in your if [ ... ] you are not comparing to its contents but to the literal string "login". Add a "$" for expansion...
# 11  
Old 11-11-2014
I thought you were expecting the word login...
RudiC hit the pin nail... if you want abc it should be
Code:
 if [ "$loginpass" = "$login" ]

Dont forget to code something to get out of the while loop... as I already mentionned...
# 12  
Old 11-11-2014
Massive thankyou to 'abe' and 'Rudic', this is my 1st time on this Forum and between you both; you helped me get this login script working. Many thanks for sharing your time with me. It is now working . . . wow seems theres no room for error in Bash Script.

rgds Willo
# 13  
Old 11-11-2014
Bug

Quote:
Originally Posted by willo
wow seems theres no room for error in Bash Script.
I see two more errors Smilie

Either remove the s in usersname or add an appropriate s to $username
Code:
    read usersname
    su Willo009 -c useradd $username

Substitute $1 by userping
Code:
    read userping
        if ! ping -c 1 -w 5 "$1" &>/dev/null

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

2. Linux

How to execute a simple select script using a shell script?

Hi team, I have two select statements and need to run them using SYSDBA user select * from temp_temp_seg_usage; select segment_name, tablespace_name, bytes/ (1024*1024) UsedMb from dba_segments where segment_name='TEMP_TEMP_SEG_USAGE'; Need to run this using a shell script say named... (1 Reply)
Discussion started by: pamsy78
1 Replies

3. Shell Programming and Scripting

Simple check login script

Hello, I just started with shell and i am doin simple script to check if certain user is logged in. Script takes 3 args. name sleep time and quit value if there is q for quit then date and user name is printed to file, not to screen. so far i have got this... login() { while :... (3 Replies)
Discussion started by: shelllo
3 Replies

4. Fedora

Simple login script in openSuSe

Hi guys, Ok so I'm basically trying to run a script on loging or after everything else has started up, I've done so much googling my head is spinning I don't understand the which file I have to edit with the details of my script, In suse there is no etc/profiles folder its daemonised so its... (1 Reply)
Discussion started by: whitenight639
1 Replies

5. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

6. Web Development

Simple Login page

Hi all, I am stepping into web-development as a hobby point of view. I am using WAMP server & have created the initial page & SQL set-up too. My problem is, I was able to login to a page/redirect to a page though I haven't specified my username & password. I thought of using both... (2 Replies)
Discussion started by: gameboy87
2 Replies

7. Shell Programming and Scripting

Simple Script Can u help please?

I have a file that contains these lines User ID Username -------- ---------- 7738626,zrazak 7783535,jvincigu 7805567,ldrennan 7805583,mtsakama I need to sort the names alphabetically How can I sort the lines based on the user names ? I would appreciate a quick reply anyone ... (1 Reply)
Discussion started by: mnassiri
1 Replies

8. UNIX for Dummies Questions & Answers

Simple script

Hi All, First time poster so be gentle - Also apologies if this is in the wrong section. I am not a unix administrator but as a Storage administrator know enouh to get me by for what I need to do. However I am having a slow night-shift so I am playing about with a bit of scripting to... (7 Replies)
Discussion started by: colinwilson1303
7 Replies

9. Shell Programming and Scripting

I need a simple script

Hi, I need a script which can apply 'cd' command . for example there is a directory: (myDirectory) #cd myDirectory (current dir is myDirectory) my script can do this: #do (current dir is myDirectory) (do is my script) Thanks. (2 Replies)
Discussion started by: mehmetned
2 Replies

10. UNIX for Dummies Questions & Answers

something simple, but i have no idea: a login issue

Hi all, I have a problem not really dramatic but realyl annoying: i've got a groups of users who logon a sunos 2.3 box via a windows telnet client (KEAI, but this is not the problem). they login as perso1 and password. It takes a very very very long time to get in. If i log on the same box... (2 Replies)
Discussion started by: penguin-friend
2 Replies
Login or Register to Ask a Question