#!/bin/bash # # Script to configure a single server OpenAFS Cell. # This will prompt you many times for the admin password. # export PATH=/usr/afs/bin:/usr/local/bin:/usr/local/sbin:$PATH #change me to your name of your cell CELLNAME=$CELLNAME #change me to your fqdn of the server SERVER=enkidu.linbsd.org #change me to your ip of your server IP=67.79.5.181 #Change me if you want a larger disk cache than 191 meg CACHESIZE=198112 #####Should not need to change anything below here.#################################################################### if [[ ! -d /usr/vice/etc ]] then mkdir -p /usr/vice/etc/ echo "made /usr/vice/etc" fi echo "$CELLNAME" > /usr/vice/etc/ThisCell echo ">$SERVER #Cell name $IP #$SERVER" > /usr/vice/etc/CellServDB echo "/afs:/usr/vice/cache:$CACHESIZE" > /usr/vice/etc/cacheinfo mkdir -p /usr/vice/cache /usr/afs/bin/bosserver -noauth & bos setcellname $SERVER $CELLNAME -noauth bos listhosts $SERVER -noauth bos create $SERVER kaserver simple /usr/afs/bin/kaserver -cell $CELLNAME -noauth bos create $SERVER buserver simple /usr/afs/bin/buserver -cell $CELLNAME -noauth bos create $SERVER ptserver simple /usr/afs/bin/ptserver -cell $CELLNAME -noauth bos create $SERVER vlserver simple /usr/afs/bin/vlserver -cell $CELLNAME -noauth kas create afs -cell $CELLNAME -noauth kas create admin -cell $CELLNAME -noauth kas examine afs -cell $CELLNAME -noauth kas setfields admin -flags admin -cell $CELLNAME -noauth kas examine admin -cell $CELLNAME -noauth bos adduser $SERVER admin -cell $CELLNAME -noauth bos addkey $SERVER -kvno 0 -cell $CELLNAME -noauth bos listkeys $SERVER -cell $CELLNAME -noauth kas setpassword afs -kvno 1 -cell $CELLNAME -noauth kas examine afs -cell $CELLNAME -noauth bos addkey $SERVER -kvno 1 -cell $CELLNAME -noauth bos listkeys $SERVER -cell $CELLNAME -noauth pts createuser -name admin -cell $CELLNAME -noauth pts adduser admin system:administrators -cell $CELLNAME -noauth pts membership admin -cell $CELLNAME -noauth bos restart $SERVER -all -cell $CELLNAME -noauth bos create $SERVER fs fs /usr/afs/bin/fileserver /usr/afs/bin/volserver /usr/afs/bin/salvager -cell $CELLNAME -noauth bos status $SERVER fs -long -noauth echo "do the rest" vos create $SERVER /vicepa root.afs -cell $CELLNAME -noauth vos syncvldb $SERVER -cell $CELLNAME -verbose -noauth vos syncserv $SERVER -cell $CELLNAME -verbose -noauth bos create $SERVER upserver simple "/usr/afs/bin/upserver -crypt /usr/afs/etc -clear /usr/afs/bin" -cell $CELLNAME -noauth bos create $SERVER runntp simple "/usr/afs/bin/runntp -localclock" -cell $CELLNAME -noauth mkdir /afs fs setacl /afs system:anyuser rl vos create $SERVER /vicepa root.cell fs mkmount /afs/$CELLNAME root.cell fs setacl /afs/$CELLNAME system:anyuser rl bos shutdown $SERVER -wait ps auxwww|grep bosserver killall -9 bosserver echo "time to reboot and test afs script! Hit to continue" read foo #vi /etc/sysconfig/afs