| 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 | PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER |
| 9 | |
| 10 | echo == creating user $USER ====================================================================== |
| 11 | (ssh $ADMIN@fyodor.hcoop.net cat /home/$USER/.mire-password\; cat /home/$USER/.mire-password) | \ |
| 12 | /afs/hcoop.net/common/etc/scripts/create-user $USER && ( |
| 13 | echo == account created successfully ======================================================== |
| 14 | echo == deleting .mire-password ============================================================= |
| 15 | ssh $ADMIN@fyodor.hcoop.net 'echo -n > /home/$USER/.mire-password' |
| 16 | echo == sending email to $USER@hcoop.net ==================================================== |
| 17 | mail -s 'your account on mire.hcoop.net has been created' $USER@hcoop.net <<EOF |
| 18 | Enjoy! |
| 19 | |
| 20 | ______________________________________________________________________________ |
| 21 | BETA STATUS |
| 22 | |
| 23 | Please remember that mire accounts are still in "beta testing", so we |
| 24 | cannot (yet) guarantee uptime or service. Please do not migrate |
| 25 | any important services to your mire account. |
| 26 | |
| 27 | ______________________________________________________________________________ |
| 28 | SSH Access |
| 29 | |
| 30 | You can access your new account by typing: |
| 31 | |
| 32 | ssh $USER@mire.hcoop.net |
| 33 | |
| 34 | ... using the password previously in fyodor:~/.mire-password. For |
| 35 | security, that file has been blanked out. |
| 36 | |
| 37 | ______________________________________________________________________________ |
| 38 | AFS (direct) Access |
| 39 | |
| 40 | Your AFS filespace is located at: |
| 41 | |
| 42 | /afs/hcoop.net/user/$PATHBITS/ |
| 43 | |
| 44 | If you like, you can access this storage directly from your local |
| 45 | machine, without having to use ssh or scp. To do so, follow the |
| 46 | instructions at the link below, substituting "HCOOP.NET" and |
| 47 | "hcoop.net" for the realm name and cell name, respectively. |
| 48 | Capitalization matters. |
| 49 | |
| 50 | http://research.cs.berkeley.edu/doc/afs/ |
| 51 | |
| 52 | Sincerely, |
| 53 | |
| 54 | - your hcoop admins |
| 55 | |
| 56 | EOF |
| 57 | echo |
| 58 | echo |
| 59 | echo |
| 60 | ) |
| 61 | done |