Mercurial > hg > anonet-resdb
annotate configure @ 55:385e3f464af2 draft
general updates and fixes
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Wed, 16 Jun 2010 03:18:17 +0000 |
parents | 41b330b11a33 |
children | b295bc1fe853 |
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 |
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
3 vars="gitd_ip gitd_basepath tinydns_config tinydns__tldsrvrname tinydns__tldsrvrip" |
9
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 |
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
9 export "$var"="$(cat conf/$var 2>/dev/null)" |
9
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 |
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
14 if [ x"$tinydns_config" = x ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
15 tinydns_config=n |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
16 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
17 if [ x"$tinydns__tldsrvrname" = x ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
18 tinydns__tldsrvrname="uz5fvb7zdqyuz4q8ysjdfuf04kzd2lrt0l6fp4uyguxdg5tfut06ck.anons.somerandomnick.ano" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
19 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
20 if [ x"$tinydns__tldsrvrip" = x ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
21 tinydns__tldsrvrip="1.0.27.37" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
22 fi |
9
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
23 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
24 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
|
25 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
|
26 echo -n "IP? " >&2 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
27 read new_gitd_ip |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
28 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
|
29 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
|
30 fi |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
31 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
32 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
|
33 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
|
34 echo -n "BasePath? " >&2 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
35 read new_gitd_basepath |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
36 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
|
37 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
|
38 fi |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
39 |
12
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
40 echo -n "Would you like to configure the tinydns datafile generator? " >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
41 read new_tinydns_config |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
42 if [ x"$new_tinydns_config" != x ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
43 tinydns_config="$new_tinydns_config" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
44 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
45 if [ x"$tinydns_config" = xy ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
46 echo "Please enter the hostname of your .ano TLD server." >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
47 echo "(Default: $tinydns__tldsrvrname)" >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
48 echo -n "TLDSrvName? " >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
49 read new_tinydns__tldsrvrname |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
50 if [ x"$new_tinydns__tldsrvrname" != x ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
51 tinydns__tldsrvrname="$new_tinydns__tldsrvrname" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
52 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
53 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
54 echo "Please enter the IP address of your .ano TLD server." >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
55 echo "(Default: $tinydns__tldsrvrip)" >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
56 echo -n "TLDSrvIP? " >&2 |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
57 read new_tinydns__tldsrvrip |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
58 if [ x"$new_tinydns__tldsrvrip" != x ]; then |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
59 tinydns__tldsrvrip="$new_tinydns__tldsrvrip" |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
60 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
61 fi |
41b330b11a33
coded a tinydns datafile generator
Nick <nick@somerandomnick.ano>
parents:
9
diff
changeset
|
62 |
9
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
63 echo "Proposed configuration:" >&2 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
64 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
|
65 echo "$var=${!var}" >&2 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
66 done |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
67 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
|
68 read write_config |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
69 |
8f9565400a0f
added configure script (so you don't have to modify gitd itself)
Nick <nick@somerandomnick.ano>
parents:
diff
changeset
|
70 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
|
71 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
|
72 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
|
73 done |