use "fs ls" as test in create-user, improve kadmin error checking
[hcoop/scripts.git] / make-account-for-fyodor-user
1 #!/bin/bash
2
3 ADMIN=`whoami | sed s/_.*//`
4 echo "assuming that I am $ADMIN@fyodor..."
5
6 for USERHOME in `ssh $ADMIN@fyodor.hcoop.net cd /home\; find */.mire-password -size +0`; do
7 USER=`dirname $USERHOME`
8
9 echo == creating user $USER ======================================================================
10 (ssh $ADMIN@fyodor.hcoop.net cat /home/$USER/.mire-password\; cat /home/$USER/.mire-password) | \
11 /afs/hcoop.net/common/etc/scripts/create-user $USER && (
12 echo == account created successfully ========================================================
13 echo == deleting .mire-password =============================================================
14 ssh $ADMIN@fyodor.hcoop.net 'echo -n > /home/$USER/.mire-password'
15 )
16 done