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