annotate configure @ 9:8f9565400a0f draft

added configure script (so you don't have to modify gitd itself)
author Nick <nick@somerandomnick.ano>
date Sun, 18 Apr 2010 08:05:34 +0000
parents
children 41b330b11a33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
1 #!/bin/sh
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
3 vars="gitd_ip gitd_basepath"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
4
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
5 echo "Welcome to the resdb configurator!" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
6 echo >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
7
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
8 for var in $vars ; do
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
9 export "$var"="$(cat conf/$var)"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
10 done
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
11 if [ x"$gitd_basepath" = x ]; then
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
12 gitd_basepath="$(pwd)/"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
13 fi
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
14
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
15 echo "Please enter the IP address you'd like gitd to listen on." >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
16 echo "(Default: $gitd_ip)" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
17 echo -n "IP? " >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
18 read new_gitd_ip
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
19 if [ x"$new_gitd_ip" != x ]; then
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
20 gitd_ip="$new_gitd_ip"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
21 fi
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
22
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
23 echo "Please enter the full path to resdb." >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
24 echo "(Default: $gitd_basepath)" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
25 echo -n "BasePath? " >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
26 read new_gitd_basepath
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
27 if [ x"$new_gitd_basepath" != x ]; then
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
28 gitd_basepath="$new_gitd_basepath"
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
29 fi
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
30
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
31 echo "Proposed configuration:" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
32 for var in $vars ; do
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
33 echo "$var=${!var}" >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
34 done
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
35 echo -n "To write the configuration, hit RETURN. To abort, hit ^C: " >&2
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
36 read write_config
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
37
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
38 mkdir -p conf || exit 1
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
39 for var in $vars ; do
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
40 echo "${!var}" > conf/"$var" || exit 1
8f9565400a0f added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff changeset
41 done