Script to prompt Linux user for hostname and unique NFS share

Reply

Join Date: Nov 2008
Posts: 2
Reputation: Mujzeptu is an unknown quantity at this point 
Solved Threads: 0
Mujzeptu Mujzeptu is offline Offline
Newbie Poster

Script to prompt Linux user for hostname and unique NFS share

 
0
  #1
Nov 20th, 2008
As the title suggests, I am wanting to create a simple script for system administrators.

When you run this script in a linux shell, it will ask you what you want to set the local systems hostname to (so the admin can type it) and then prompt the administrator for a unique NFS path.

This way the administrator can use one image and then run this script to set the unique hostname, and then set up a local path like /mnt/nfsserver so it connects to the remote NFS server at its unique directory. This way the image doesnt have all workstations connect to the same NFS share... we want each workstation to have its own unique NFS share for their own data.

Any help or code you can provide for me? Im guessing its simple I am just not very good at shell scripting.

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 1,764
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Solved Threads: 85
Moderator
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: Script to prompt Linux user for hostname and unique NFS share

 
0
  #2
Nov 20th, 2008
are you expecting a ready script? if so, seach on google. if not, and you have a script that doesn't work, post it here, and we will try to see if we can help fix it
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 2
Reputation: Mujzeptu is an unknown quantity at this point 
Solved Threads: 0
Mujzeptu Mujzeptu is offline Offline
Newbie Poster

Re: Script to prompt Linux user for hostname and unique NFS share

 
0
  #3
Nov 20th, 2008
Well, I have looked on google and am not finding much.

While I would appreciate someone making me the script, I am fine figuring out the commands and such.

The REAL issue I have that I want someone to "show me the code" on is how do I have a shell script prompt for user input to insert the command? I am just used to automatically running a command, but have never had to prompt for user input...
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 61
Reputation: Gromit is an unknown quantity at this point 
Solved Threads: 7
Gromit's Avatar
Gromit Gromit is offline Offline
Junior Poster in Training

Re: Script to prompt Linux user for hostname and unique NFS share

 
0
  #4
Nov 20th, 2008
Check out "read"! It will take the user input and do whatever you want with it.

Shell Scripting Syntax (Toggle Plain Text)
  1. read -p "what is your name? " name
  2. echo "Nice to meet you $name"

Hope that helps!
-G
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC