blob: 9f6c8c06df0a44d7530ca1199e6491920f066652 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#!/bin/sh
vars="gitd_ip gitd_basepath git_name git_email tinydns_config tinydns__tldsrvrname tinydns__tldsrvrip"
echo "Welcome to the resdb configurator!" >&2
echo >&2
for var in $vars ; do
export "$var"="$(cat conf/$var 2>/dev/null)"
done
if [ x"$gitd_basepath" = x ]; then
gitd_basepath="$(pwd)/"
fi
if [ x"$git_name" = x ]; then
git_name="Anonymous Coward"
fi
if [ x"$git_email" = x ]; then
git_email="nobody@nowhere"
fi
if [ x"$tinydns_config" = x ]; then
tinydns_config=n
fi
if [ x"$tinydns__tldsrvrname" = x ]; then
tinydns__tldsrvrname="uz5fvb7zdqyuz4q8ysjdfuf04kzd2lrt0l6fp4uyguxdg5tfut06ck.anons.somerandomnick.ano"
fi
if [ x"$tinydns__tldsrvrip" = x ]; then
tinydns__tldsrvrip="1.0.27.37"
fi
echo "Please enter the IP address you'd like gitd to listen on." >&2
echo "(Default: $gitd_ip)" >&2
echo -n "IP? " >&2
read new_gitd_ip
if [ x"$new_gitd_ip" != x ]; then
gitd_ip="$new_gitd_ip"
fi
echo "Please enter the full path to resdb." >&2
echo "(Default: $gitd_basepath)" >&2
echo -n "BasePath? " >&2
read new_gitd_basepath
if [ x"$new_gitd_basepath" != x ]; then
gitd_basepath="$new_gitd_basepath"
fi
echo "Please enter your name." >&2
echo "(Default: $git_name)" >&2
echo -n "Name? " >&2
read new_git_name
if [ x"$new_git_name" != x ]; then
git_name="$new_git_name"
fi
echo "Please enter your email." >&2
echo "(Default: $git_email)" >&2
echo -n "Email? " >&2
read new_git_email
if [ x"$new_git_email" != x ]; then
git_email="$new_git_email"
fi
echo -n "Would you like to configure the tinydns datafile generator? " >&2
read new_tinydns_config
if [ x"$new_tinydns_config" != x ]; then
tinydns_config="$new_tinydns_config"
fi
if [ x"$tinydns_config" = xy ]; then
echo "Please enter the hostname of your .ano TLD server." >&2
echo "(Default: $tinydns__tldsrvrname)" >&2
echo -n "TLDSrvName? " >&2
read new_tinydns__tldsrvrname
if [ x"$new_tinydns__tldsrvrname" != x ]; then
tinydns__tldsrvrname="$new_tinydns__tldsrvrname"
fi
echo "Please enter the IP address of your .ano TLD server." >&2
echo "(Default: $tinydns__tldsrvrip)" >&2
echo -n "TLDSrvIP? " >&2
read new_tinydns__tldsrvrip
if [ x"$new_tinydns__tldsrvrip" != x ]; then
tinydns__tldsrvrip="$new_tinydns__tldsrvrip"
fi
fi
echo "Proposed configuration:" >&2
for var in $vars ; do
echo "$var=${!var}" >&2
done
echo -n "To write the configuration, hit RETURN. To abort, hit ^C: " >&2
read write_config
echo -n "Writing configuration... " >&2
mkdir -p conf || exit 1
for var in $vars ; do
echo "${!var}" > conf/"$var" || exit 1
done
echo "Done" >&2
echo -n "Updating git configuration... " >&2
cd "$(cat ./conf/gitd_basepath)" || exit 1
git config user.name "$(cat ./conf/git_name)" || exit 1
git config user.email "$(cat ./conf/git_email)" || exit 1
echo "Done" >&2
|