#!/bin/sh


# current first maximum replicated volume id
cd /vice/vol
echo 2130706432 > maxgroupid

#
# setting up servers file
#

id=""
echo
echo Setting up servers file.
#
# making hostname
#

hn=`hostname`
bn=${hn%%.*}
if [ x$bn = x ]; then
    bn=$hn
fi
cd /vice/db

until [ x$id != x ]; do
   echo -n 'Enter an id for this server (a number > 0 < 255) : '
   read id
   if [ x$id != x ]; then
      echo -n "$bn		$id" >> servers
   fi
done
echo done!

#
#  this is the scm so put hostname in /vice/db/scm
#
echo $bn > /vice/db/scm

#
# set up the initial VSG on the SCM; this is the SCM itself only. 
#
echo "Initializing the VSGDB to contain the SCM as E0000100"
echo E0000100 $bn > /vice/db/VSGDB
echo /vice/db/VSGDB set up

id=""
echo
echo Setting up ROOTVOLUME file
cd /vice/db
until [ x$id != x ]; do
   echo -n 'Enter the name of the rootvolume (< 32 chars) : '
   read id
   if [ x$id != x ]; then
	echo $id > /vice/db/ROOTVOLUME
   fi
done
echo
echo


