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