diff options
author | Nick <nick@somerandomnick.ano> | 2010-04-18 08:05:34 +0000 |
---|---|---|
committer | Nick <nick@somerandomnick.ano> | 2010-04-18 08:05:34 +0000 |
commit | 288b4dec2ea9e137f332ad82a280293d0161c3bc (patch) | |
tree | d4d1b38d3f8009f21602979679c298ceb5d7d82b | |
parent | 390c762f5dd893c3905783bc905a18870da3a1a0 (diff) | |
download | resdb-288b4dec2ea9e137f332ad82a280293d0161c3bc.tar.gz resdb-288b4dec2ea9e137f332ad82a280293d0161c3bc.zip |
added configure script (so you don't have to modify gitd itself)
-rwxr-xr-x | configure | 41 | ||||
-rwxr-xr-x | gitd | 3 |
2 files changed, 43 insertions, 1 deletions
diff --git a/configure b/configure new file mode 100755 index 0000000..00f72f4 --- /dev/null +++ b/configure @@ -0,0 +1,41 @@ +#!/bin/sh + +vars="gitd_ip gitd_basepath" + +echo "Welcome to the resdb configurator!" >&2 +echo >&2 + +for var in $vars ; do + export "$var"="$(cat conf/$var)" +done +if [ x"$gitd_basepath" = x ]; then + gitd_basepath="$(pwd)/" +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 "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 + +mkdir -p conf || exit 1 +for var in $vars ; do + echo "${!var}" > conf/"$var" || exit 1 +done @@ -1,2 +1,3 @@ #!/bin/sh -git daemon --listen=1.0.27.102 --base-path=/home/www/resdb/ +repodir="$(basename $0)" +exec git daemon --listen="$(cat "$repodir"/conf/gitd_ip)" --base-path="$(cat "$repodir"/conf/gitd_basepath)" |