hcoop: remove mccarthy and navajos from domtool control
[hcoop/domtool2.git] / bootstrap / bootstrap
1 #!/bin/sh -e
2
3 # Bootstrap everything for a DEVELOPMENT ENVIRONMENT (an insecure one
4 # at that), assuming you are going to be domtool root
5
6 # prepend build tree versions of domtool programs for bootstrapping
7 BOOTSTRAP_PATH=../bin:../scripts:$PATH
8
9 create_user="$1"
10
11 if [ -z "`getent passwd domtool`" ]; then
12 if [ "$create_user" = "-create-user" ]; then
13 echo "creating domtool user..."
14 adduser --disabled-password domtool || (echo "failed!" ; exit 1)
15 else if [ "$create_user" = "-skip-create-user" ]; then
16 echo "skipping domtool user creation"
17 else
18 echo "domtool user does not exist. To create, run $0 -create-user, to skip run $0 -skip-create-user"
19 exit 1
20 fi
21 fi
22
23 fi
24
25 ./domtool-create-shared-root
26 ./domtool-install-lib
27 ./domtool-create-local-root
28 ./domtool-create-ca -force
29 ./domtool-init-truststore
30 ./domtool-init-acl `whoami`
31 PATH=$BOOTSTRAP_PATH ../scripts/domtool-addcert `uname -n` -unsafe
32
33 PATH=$BOOTSTRAP_PATH ../bin/domtool-server &
34 SERVER_PID=$!
35
36 echo "waiting five seconds for domtool to coalesce"
37 sleep 5 # give domtool a chance to start
38
39 PATH=$BOOTSTRAP_PATH ../scripts/domtool-adduser `whoami` -unsafe
40
41 kill $SERVER_PID