#!/bin/bash if [ -z "$1" ] then printf 'Repository : ' read set "$REPLY" fi if [ ! -f "$1/HEAD" ] then echo 'Not a repository!' exit 1 fi if [ ! -w "$1/HEAD" ] then echo 'Read-only repository!' exit 2 fi if [ -z "$2" ] then printf 'Homepage URL: ' read set "$1" "$REPLY" fi if cd "$1" then if [ "$2" = 'initial' ] then git config unset --file ./config gitweb.homepage else git config set --file ./config gitweb.homepage "$2" fi fi