Mercurial > hg > anonet-resdb
comparison configure @ 287:b295bc1fe853 draft
updated configure script to help hide identity
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Sun, 05 Dec 2010 17:45:32 +0000 |
parents | 41b330b11a33 |
children | 2e7d34122df5 |
comparison
equal
deleted
inserted
replaced
286:9dc804527a1f | 287:b295bc1fe853 |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 vars="gitd_ip gitd_basepath tinydns_config tinydns__tldsrvrname tinydns__tldsrvrip" | 3 vars="gitd_ip gitd_basepath git_name git_email tinydns_config tinydns__tldsrvrname tinydns__tldsrvrip" |
4 | 4 |
5 echo "Welcome to the resdb configurator!" >&2 | 5 echo "Welcome to the resdb configurator!" >&2 |
6 echo >&2 | 6 echo >&2 |
7 | 7 |
8 for var in $vars ; do | 8 for var in $vars ; do |
9 export "$var"="$(cat conf/$var 2>/dev/null)" | 9 export "$var"="$(cat conf/$var 2>/dev/null)" |
10 done | 10 done |
11 if [ x"$gitd_basepath" = x ]; then | 11 if [ x"$gitd_basepath" = x ]; then |
12 gitd_basepath="$(pwd)/" | 12 gitd_basepath="$(pwd)/" |
13 fi | |
14 if [ x"$git_name" = x ]; then | |
15 git_name="Anonymous Coward" | |
16 fi | |
17 if [ x"$git_email" = x ]; then | |
18 git_email="nobody@nowhere" | |
13 fi | 19 fi |
14 if [ x"$tinydns_config" = x ]; then | 20 if [ x"$tinydns_config" = x ]; then |
15 tinydns_config=n | 21 tinydns_config=n |
16 fi | 22 fi |
17 if [ x"$tinydns__tldsrvrname" = x ]; then | 23 if [ x"$tinydns__tldsrvrname" = x ]; then |
33 echo "(Default: $gitd_basepath)" >&2 | 39 echo "(Default: $gitd_basepath)" >&2 |
34 echo -n "BasePath? " >&2 | 40 echo -n "BasePath? " >&2 |
35 read new_gitd_basepath | 41 read new_gitd_basepath |
36 if [ x"$new_gitd_basepath" != x ]; then | 42 if [ x"$new_gitd_basepath" != x ]; then |
37 gitd_basepath="$new_gitd_basepath" | 43 gitd_basepath="$new_gitd_basepath" |
44 fi | |
45 | |
46 echo "Please enter your name." >&2 | |
47 echo "(Default: $git_name)" >&2 | |
48 echo -n "Name? " >&2 | |
49 read new_git_name | |
50 if [ x"$new_git_name" != x ]; then | |
51 git_name="$new_git_name" | |
52 fi | |
53 | |
54 echo "Please enter your email." >&2 | |
55 echo "(Default: $git_email)" >&2 | |
56 echo -n "Email? " >&2 | |
57 read new_git_email | |
58 if [ x"$new_git_email" != x ]; then | |
59 git_name="$new_git_email" | |
38 fi | 60 fi |
39 | 61 |
40 echo -n "Would you like to configure the tinydns datafile generator? " >&2 | 62 echo -n "Would you like to configure the tinydns datafile generator? " >&2 |
41 read new_tinydns_config | 63 read new_tinydns_config |
42 if [ x"$new_tinydns_config" != x ]; then | 64 if [ x"$new_tinydns_config" != x ]; then |
65 echo "$var=${!var}" >&2 | 87 echo "$var=${!var}" >&2 |
66 done | 88 done |
67 echo -n "To write the configuration, hit RETURN. To abort, hit ^C: " >&2 | 89 echo -n "To write the configuration, hit RETURN. To abort, hit ^C: " >&2 |
68 read write_config | 90 read write_config |
69 | 91 |
92 echo -n "Writing configuration... " >&2 | |
70 mkdir -p conf || exit 1 | 93 mkdir -p conf || exit 1 |
71 for var in $vars ; do | 94 for var in $vars ; do |
72 echo "${!var}" > conf/"$var" || exit 1 | 95 echo "${!var}" > conf/"$var" || exit 1 |
73 done | 96 done |
97 echo "Done" >&2 | |
98 | |
99 echo -n "Updating git configuration... " >&2 | |
100 cd "$(cat ./conf/gitd_basepath)" || exit 1 | |
101 git config user.name "$(cat ./conf/git_name)" || exit 1 | |
102 git config user.email "$(cat ./conf/git_email)" || exit 1 | |
103 echo "Done" >&2 |