Mercurial > hg > anonet-resdb
comparison 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 |
comparison
equal
deleted
inserted
replaced
8:24d6e1959175 | 9:8f9565400a0f |
---|---|
1 #!/bin/sh | |
2 | |
3 vars="gitd_ip gitd_basepath" | |
4 | |
5 echo "Welcome to the resdb configurator!" >&2 | |
6 echo >&2 | |
7 | |
8 for var in $vars ; do | |
9 export "$var"="$(cat conf/$var)" | |
10 done | |
11 if [ x"$gitd_basepath" = x ]; then | |
12 gitd_basepath="$(pwd)/" | |
13 fi | |
14 | |
15 echo "Please enter the IP address you'd like gitd to listen on." >&2 | |
16 echo "(Default: $gitd_ip)" >&2 | |
17 echo -n "IP? " >&2 | |
18 read new_gitd_ip | |
19 if [ x"$new_gitd_ip" != x ]; then | |
20 gitd_ip="$new_gitd_ip" | |
21 fi | |
22 | |
23 echo "Please enter the full path to resdb." >&2 | |
24 echo "(Default: $gitd_basepath)" >&2 | |
25 echo -n "BasePath? " >&2 | |
26 read new_gitd_basepath | |
27 if [ x"$new_gitd_basepath" != x ]; then | |
28 gitd_basepath="$new_gitd_basepath" | |
29 fi | |
30 | |
31 echo "Proposed configuration:" >&2 | |
32 for var in $vars ; do | |
33 echo "$var=${!var}" >&2 | |
34 done | |
35 echo -n "To write the configuration, hit RETURN. To abort, hit ^C: " >&2 | |
36 read write_config | |
37 | |
38 mkdir -p conf || exit 1 | |
39 for var in $vars ; do | |
40 echo "${!var}" > conf/"$var" || exit 1 | |
41 done |