X-Git-Url: http://git.hcoop.net/clinton/scripts.git/blobdiff_plain/5debfe01c15938323eafca20f3b69b8f31e69b3c..241a0263b49eb5a72ff9d4ef14d50f351c93e1f9:/create-user diff --git a/create-user b/create-user index 0e999ce..d374f35 100755 --- a/create-user +++ b/create-user @@ -9,6 +9,21 @@ # - while holding tokens for a user who is: # - a member of system:administrator # - listed in 'bos listusers deleuze' +# - and who has been set up with Domtool admin privileges by: +# - running 'domtool-adduser $USER' while holding AFS admin tokens as +# someone who is already a Domtool admin +# - running 'domtool-admin grant $USER priv all' as someone who is already a +# Domtool admin +# (To bootstrap yourself into admindom: +# 1. Run '/etc/init.d/domtool-server stop' on deleuze. +# 2. Run '/etc/init.d/domtool-slave stop' on all Domtool slave machines +# (e.g., mire). +# 3. Edit ~domtool/acl, following the example of adamc_admin to grant +# yourself 'priv all'. +# 4. Run '/etc/init.d/domtool-server start' on deleuze. +# 5. Run '/etc/init.d/domtool-slave start' on all Domtool slave +# machines. +# 6. Run 'domtool-adduser' as above.) USER=$1 @@ -206,23 +221,23 @@ if test -f $HOMEPATH/Maildir/shared-maildirs; then # This does not yet seem to be needed, and it triggers an AFS issue, # so I've commented it out --mwolson. # -# NOTIFY=no -# for dir in $HOMEPATH/Maildir/shared-folders/SpamAssassin/*; do -# if ! test -d $dir; then -# NOTIFY=yes -# else -# dest=/var/local/lib/spamd/Maildir/.$(basename $dir) -# if test "$(readlink $dir/shared)" != "$dest"; then -# ln -sf $dest $dir/shared -# fi -# fi -# done -# if test $NOTIFY = yes; then -# # This is probably going overboard, but oh well -# echo "$USER needs assistance on their shared spam dir" | \ -# mail -s "[create-user] $USER needs assistance" \ -# -e -a "From: admins@deleuze.hcoop.net" mwolson_admin -# fi +NOTIFY=no +for dir in $HOMEPATH/Maildir/shared-folders/SpamAssassin/*; do + if ! test -d $dir; then + NOTIFY=yes + else + dest=/var/local/lib/spamd/Maildir/.$(basename $dir) + if test "$(readlink $dir/shared)" != "$dest"; then + ln -sf $dest $dir/shared + fi + fi +done +if test $NOTIFY = yes; then + # This is probably going overboard, but oh well + echo "$USER needs assistance on their shared spam dir" | \ + pagsh -c mail -s "[create-user] $USER needs assistance" \ + -e -a "From: admins@deleuze.hcoop.net" mwolson_admin +fi else maildirmake --add SpamAssassin=/var/local/lib/spamd/Maildir \