basic internal ipv6 support
[hcoop/domtool2.git] / bootstrap / bootstrap
CommitLineData
7b050e1a 1#!/bin/sh -e
0f9f712c
CE
2
3# Bootstrap everything for a DEVELOPMENT ENVIRONMENT (an insecure one
4# at that), assuming you are going to be domtool root
5
e7dd9e9b
CE
6# prepend build tree versions of domtool programs for bootstrapping
7BOOTSTRAP_PATH=../bin:../scripts:$PATH
8
9create_user="$1"
10
0f9f712c 11if [ -z "`getent passwd domtool`" ]; then
e7dd9e9b
CE
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
0f9f712c
CE
23fi
24
25./domtool-create-shared-root
2a73fe51 26./domtool-install-lib
0f9f712c
CE
27./domtool-create-local-root
28./domtool-create-ca -force
29./domtool-init-truststore
30./domtool-init-acl `whoami`
e7dd9e9b 31PATH=$BOOTSTRAP_PATH ../scripts/domtool-addcert `uname -n` -unsafe
7b050e1a 32
e7dd9e9b 33PATH=$BOOTSTRAP_PATH ../bin/domtool-server &
0a26706f
CE
34SERVER_PID=$!
35
e7dd9e9b
CE
36echo "waiting five seconds for domtool to coalesce"
37sleep 5 # give domtool a chance to start
38
39PATH=$BOOTSTRAP_PATH ../scripts/domtool-adduser `whoami` -unsafe
0a26706f
CE
40
41kill $SERVER_PID