Results 1 to 3 of 3
To start I am and intermediate Linux user. And a beginner when it comes to scripting.
I work with Linux all day at work and I am learning a lot ...
- 05-24-2010 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 5
How can I change users shile a script is running
To start I am and intermediate Linux user. And a beginner when it comes to scripting.
I work with Linux all day at work and I am learning a lot but I am stumped. Recently i have been handed a project of proactively replacing a few thousand Server drives.
I walk the customer though installing the existing server in the backup location and installing a new server in the primary location. ie hdc and hda locations.
I am trying to put all the commands and some extras into one script.
There are a few areas which require me to log out of root and then log back in as root.
Can I automate this in my script. Ideally I would like this to become more easier with just 1 command. ie ./restore or something of that nature.
Also can I have the script check which drives are mounted and proceed depending on the results. ie If the hdc is already mounted.... stop.
Thank You all for any advice you have.
- 05-24-2010 #2
sudo comes to mind.
But that would mean, you need to deploy an appropiate sudo config on all the servers beforehand. Is that a possibility?You must always face the curtain with a bow.
- 05-24-2010 #3Just Joined!
- Join Date
- Nov 2009
- Posts
- 5
Unfortunately that is not possible. I was going to attempt that but sudo is not recognized as a command. Just su.


Reply With Quote