How to determine which user to put onto which Sun server

The idea is pretty simple and should work well. From our 12 Sun servers currently set-up for users, we will dedicate 10 for users' home for the time being. This simple script will tell you on which server your home is:

#!/bin/bash

if [ "" == "$1" ]; then
    echo Please give me a user name
    exit 1
fi
USER=$1

# calculate user storage server by sha1sum of the user name and taking this result mod 10
STORAGE=`echo -e "obase=10\nibase=16\n1+" \`echo -n $USER | sha1sum | cut -d' ' -f 1 | tr 'a-f' 'A-F' \` " % A" | bc`

printf "s%02d\n" $STORAGE

So far:

s01 pankow (temp: s12)
s01 shusa (temp: s12)
s02 carsten
s02 jrollins
s02 sfairhur
s02 steffeng
s02 tradke
s03 bonnie
s03 hpletsch
s03 matthew
s03 smarka
s04 ballen
s04 bema
s04 miroslav
s04 pau
s04 repr
s04 thorne
s05 chmess
s05 fehrmann
s05 igor
s05 papa
s05 shaon
s06 bose
s06 gjones
s06 greschner
s06 psutton
s06 stas
s07 benk (temp: s12)
s07 kwwette (temp: s12)
s07 linden (temp: s12)
s07 shourov (temp: s12)
s08 ajith
s08 dtalukder
s08 lucia
s09 dfazi
s09 klimenko
s10 brevilo
s10 christian
s10 skoranda

-- CarstenAulbert - 14 Jul 2008
Topic revision: r9 - 05 Aug 2008, HenningFehrmann
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback