Index: /trunk/source/afs-config/update-cellservdb =================================================================== --- /trunk/source/afs-config/update-cellservdb (revision 195) +++ /trunk/source/afs-config/update-cellservdb (revision 195) @@ -0,0 +1,36 @@ +#!/usr/bin/perl +use strict; +use warnings; + +my %cm_servers; +open(FS, '-|', 'fs', 'listcells', '-numeric') or die; +while () { + if (/^Cell dynroot on hosts\.$/) { + } elsif (/^Cell (\S+) on hosts (.+)\.$/) { + $cm_servers{$1} = [split(' ', $2)]; + } else { + die; + } +} +close(FS) or die; + +my %csdb_servers; +my $cell; +open(CSDB, '<', '/etc/openafs/CellServDB') or die; +while () { + if (/^>([^#\s]+)/) { + $cell = $1; + } elsif (/^([^#\s]+)/) { + push(@{$csdb_servers{$cell}}, $1); + } else { + die; + } +} +close(CSDB); + +while (my ($cell, $servers) = each(%csdb_servers)) { + if (!exists($cm_servers{$cell}) or + join(' ', sort(@{$cm_servers{$cell}})) ne join(' ', sort(@$servers))) { + system('fs', 'newcell', '-name', $cell, '-servers', @$servers); + } +} Index: /trunk/source/afs-config/copyright =================================================================== --- /trunk/source/afs-config/copyright (revision 112) +++ /trunk/source/afs-config/copyright (revision 195) @@ -3,2 +3,5 @@ , both projects of the MIT Student Information Processing Board, and is released to the public domain. + +update-cellservdb is Copyright (C) 2009 Anders Kaseorg +, and is released under the MIT license.