3 ADMIN
=`whoami | sed s/_.*//`
4 echo "assuming that I am $ADMIN@fyodor..."
5 export PATH
=/afs
/hcoop.net
/common
/etc
/scripts
/:$PATH
7 for USERHOME
in `ssh $ADMIN@fyodor.hcoop.net cd /home\; sudo find */.mire-password -size +0`; do
8 USER
=`dirname $USERHOME`
9 PATHBITS
=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
11 echo == creating user
$USER ======================================================================
12 echo ssh $ADMIN@fyodor.hcoop.net
"sudo cat /home/$USER/.mire-password"
13 ssh $ADMIN@fyodor.hcoop.net
"sudo cat /home/$USER/.mire-password" || \
14 (echo == sending complaint to
$USER@hcoop.net
====================================================;\
15 echo 'please have a fyodor admin fix it (Adam Megacz is not a fyodor admin)' |\
16 mail -a 'From: Adam Megacz <megacz@hcoop.net>' \
18 -s "you have damaged the permissions on your ~/.mire-password" $USER@hcoop.net
)
19 ssh $ADMIN@fyodor.hcoop.net
'sudo cat /home/$USER/.mire-password' && \
20 create-user
$USER && \
21 (ssh $ADMIN@fyodor.hcoop.net
"(sudo cat /home/$USER/.mire-password;echo)|head -n 1;(sudo cat /home/$USER/.mire-password;echo)|head -n 1" |\
22 change-user-password
"$USER") && \
23 (echo == account created successfully
========================================================
24 echo == deleting .mire-password
=============================================================
25 ssh $ADMIN@fyodor.hcoop.net
"sudo rm /home/$USER/.mire-password; sudo touch /home/$USER/.mire-password"
26 echo == sending email to
$USER@hcoop.net
====================================================
28 mail -a 'From: Adam Megacz <megacz@hcoop.net>' \
29 -s "account created for user $USER" admins@hcoop.net
30 mail -a 'From: Adam Megacz <megacz@hcoop.net>' \
31 -s 'your account on mire.hcoop.net has been created' $USER@hcoop.net
<<EOF
34 ______________________________________________________________________________
37 Please remember that mire accounts are still in "beta testing", so we
38 cannot (yet) guarantee uptime or service. Please do not migrate
39 any important services to your mire account.
41 ______________________________________________________________________________
44 You can access your new account by typing:
46 ssh $USER@mire.hcoop.net
48 ... using the password previously in fyodor:~/.mire-password. For
49 security, that file has been blanked out.
51 ______________________________________________________________________________
54 Your AFS filespace is located at:
56 /afs/hcoop.net/user/$PATHBITS/
58 If you like, you can access this storage directly from your local
59 machine, without having to use ssh or scp. To do so, follow the
60 instructions at the link below, substituting "HCOOP.NET" and
61 "hcoop.net" for the realm name and cell name, respectively.
62 Capitalization matters.
64 http://research.cs.berkeley.edu/doc/afs/