TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:17836] Fun with bash



You're using sh... how is that bash scripting? :)

Gabe

> 
> Bunch of stuff I got tired of typing:
> 
> NT droped the Samba connection again...
> #!/bin/sh
> umount /mnt/ltiflex/ltirdbms/andyzb
> sleep 2
> mount /mnt/ltiflex/ltirdbms/andyzb
> 
> Simplify adding users:
> #! /bin/sh
> # Quick and dirty Script to add a new
> # "NT Dummy" account to LTI's linux servers
> # Usage: newuser USERNAME
> USER=$1
> # Properly sets up a user with a disabled password
> adduser --disabled-password $USER
> # Change shell to /bin/false
> chsh -s /bin/false $USER
> # Backup /etc/passwd
> cp /etc/passwd /etc/passwd.bak
> # Modify /etc/passwd to allow smb auth for the new user 
> cat /etc/passwd | sed s/$USER:x:/$USER:*:/gI > /etc/passwd
> # Some feedback
> echo "$USER set up!"
> # We're done here
> exit 0
> 
> Yes, bash scripting is fun and easy. I should learn perl sooner or
> later.
> 
> -- 
> Andy Zbikowski, Sys Admin   | http://www.ltiflex.com
> LTI Flexible Products, Inc. | "Reality is merely an illusion, 
> 21801 Industrial Blvd       |  albeit a very persistent one."
> Rogers, MN  55374           |  -- Albert Einstein
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
> 


-- 
--------------------------------------------------------------------------------
Gabe Turner		X-President, ACM @ U of MN	     dopp@acm.cs.umn.edu

"I'm gonna be a monkey.  Monkey, monkey, monkey......"
					- Stimpy in "Monkey See, Monkey Don't"
--------------------------------------------------------------------------------