bourne shell vs bashism fix
[hcoop/domtool2.git] / scripts / domtool-addacl
index 7555bb1..f61bd31 100755 (executable)
@@ -1,7 +1,16 @@
 #!/bin/sh -e
 
-domtool-admin grant $1 user $1
-domtool-admin grant $1 path `echo ~$1`
+USER="$1"
+if test -z "$USER"; then
+       echo Usage: domtool-addacl USERNAME
+       exit 1
+fi
+
+PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
+HOMEPATH=/afs/hcoop.net/user/$PATHBITS
+
+domtool-admin grant $USER user $USER
+domtool-admin grant $USER path $HOMEPATH
 
 # disabled since we want to discourage the use of unix groups
-#domtool-admin grant $1 group $1
\ No newline at end of file
+#domtool-admin grant $USER group $USER