2 ################################################################################
5 # Description: Makes a users home directory
6 # Author: Andrew@DeFaria.com
7 # Created: Thu Jun 3 17:21:24 PDT 1999
11 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
13 ################################################################################
14 # Set me to command name
18 adm_base=${adm_base:-$HOME/adm}
21 adm_fpath=${adm_fpath:-$adm_base/functions}
27 display "$me: Usage: makehome [ -v|erbose ] [ -d|ebug ] -username
34 function prompt_for_field {
38 while [ ! -n "$fieldvalue" ]; do
39 display "Enter the value for $fieldname:\c"
42 if [ ! -n "$fieldvalue" ]; then
43 error "Must specify $fieldname!"
50 display "-------------------------------------"
51 display "username = $username"
53 display "homedrive = $homedrive"
54 display "devdrive = $devdrive"
55 display "homepath = $homepath"
56 display "devpath = $devpath"
58 display "Command line equivalent:"
60 display "$me -username $username -uid $uid"
62 display "Are the parameters correct [Y|n]?\c"
75 error "You must be root to use this command" 1
79 dreamcicle|fudgecicle)
83 error "Must be running on either dreamcicle or fudgecicle to execute
93 while [ $# -ge 1 ]; do
108 if [ $# -le 1 ]; then
109 error "Username not specified!" 0
117 if [ $# -le 1 ]; then
118 error "UID not specified!" 0
126 error "Unknown option \"$1\" encountered" 0
134 if [ "$username" = "" ]; then
135 prompt_for_field "Username"
139 if [ "$uid" = "" ]; then
140 prompt_for_field "UID"
146 homepath=/netapp/dvd/$homedrive/$username
147 devpath=/netapp/dvd/$devdrive/$username
152 chown $uid:cdseng $homepath
155 chown $uid:cdseng $devpath
158 if [ ! -h $homepath/dev ]; then
159 ln -s /auto/dev/$username $homepath/dev