2 DIR=/etc/remctl/sipb-xen-auto
3 TEMPLATE=$DIR/conf.template
4 MACHINEDIR=$DIR/machine.d
5 MOIRADIR=$DIR/moira-acl
6 MOIRATMP=$DIR/moira-tmp
7 MACHINETMP=$DIR/machine-list-tmp
8 AUTOMACHINELIST=$DIR/auto-machine-list
9 AUTOMOIRALIST=$DIR/auto-moira-list
16 sed "s/#MACHINENAME#/$machine/g" "$TEMPLATE" | \
17 sed "s,#BINDIR#,$BINDIR,g" >| "$MACHINETMP"
18 if ! cmp -s "$MACHINEDIR/$machine" "$MACHINETMP"; then
19 mv "$MACHINETMP" "$MACHINEDIR/$machine"
28 # Should perhaps replace with LDAP, but fine for now.
30 # We should do more careful error checking so we don't take away
31 # all bits and delete the moira-acl files whenever there's an AFS
33 pts membership -nameorid "system:$group" -noauth | tail -n+2 | \
34 sed 's/\./\//; s/^ //; s/$/@ATHENA.MIT.EDU/g' >| "$MOIRATMP"
35 if test -s "$MOIRATMP"; then
36 if ! cmp -s "$MOIRADIR/$group" "$MOIRATMP"; then
37 mv "$MOIRATMP" "$MOIRADIR/$group"
40 if test -e "$MOIRADIR/$group"; then
49 update_moiragroup "$2"
53 # update the remctl.conf definitions
54 for machine in `cat "$AUTOMACHINELIST"`; do
55 update_machine "$machine"
59 # update our moira ACL lists
60 for group in `cat "$AUTOMOIRALIST"`; do
61 update_moiragroup "$group"
65 # update the list of maintained machines
66 /bin/ls "$ACLDIR" >| "$AUTOMACHINELIST"
69 # update the moira list-of-lists
70 # /bin/ls "$MOIRADIR" >| "$AUTOMOIRALIST" # BAD IDEA in case of outage
72 # This extracts the list of all moira lists we care about, and updates those.
73 grep -R moira "$ACLDIR/" /etc/remctl/acl/ | perl -pe 's/.*moira-acl\/(.*)/$1/g' >| "$AUTOMOIRALIST"
76 "$0" auto_machine_list