Writting this Bash Script to accept Arguments?

Posted by Urda on Super User See other posts from Super User or by Urda
Published on 2010-04-07T15:39:29Z Indexed on 2010/04/07 15:43 UTC
Read the original article Hit count: 604

Filed under:
|
|

How would I go about converting this bash script:

mkdir /store/sftp/%USERNAME%

sudo useradd -d /incoming %USERNAME%
sudo passwd %USERNAME%
## Password needs to be typed or passed in here
sudo usermod -g sftp %USERNAME%
sudo usermod -s /bin/false %USERNAME%

sudo chmod 755 /store/sftp/%USERNAME%
sudo chown root:root /store/sftp/%USERNAME%
sudo mkdir /store/sftp/%USERNAME%/incoming
sudo chown %USERNAME%:sftp /store/sftp/%USERNAME%/incoming

To accpet a username and a password?

© Super User or respective owner

Related posts about arguments

Related posts about bash