Re: [CentOS] sudo add user script

2013-07-18 Thread Brian Mathis
Some notes: Every time you "echo $?", you are wiping out the return status (because echo returns a success and changes $? to 0), so none of your if statements will ever catch any errors. Consider getting rid of the 'if' subtrees by negating your condition, which will make it much easier to unders

Re: [CentOS] sudo add user script

2013-07-18 Thread Mike Burger
Consider using the NOPASSWD option, on the remote systems, to allow this particular use to run this particular script. -- Mike Burger http://www.bubbanfriends.org "It's always suicide-mission this, save-the-planet that. No one ever just stops by to say 'hi' anymore." --Colonel Jack O'Neill, SG1

Re: [CentOS] sudo add user script

2013-07-18 Thread Mike Burger
Consider using the NOPASSWD option, on the remote systems, to allow this particular use to run this particular script. -- Mike Burger http://www.bubbanfriends.org "It's always suicide-mission this, save-the-planet that. No one ever just stops by to say 'hi' anymore." --Colonel Jack O'Neill, SG1

[CentOS] sudo add user script

2013-07-17 Thread Tim Dunphy
Hello list, I took another stab at finding a way to add a sudo user remotely and it gets you most of the way there. If you execute the script as root it works beautifully and does just what you want. Which is add the user to the group and gives that user group rights to certain commands. But if