#!/bin/sh## Creates git remotes from the user db# TODO: detect users' git address changes#if ! ./scripts/check_db_safety;thenexit1fiUSR_DB_DIR=./db/usrGIT_REPO=./.gitGIT_REMOTES_DIR=$GIT_REPO/refs/remotesfor u in `ls -1 $USR_DB_DIR`;dogit_url_file="$USR_DB_DIR/$u/git"if[ -f $git_url_file];thengit_url=`cat $git_url_file`git_remote_name="anonet_$u"if[ -d $GIT_REMOTES_DIR/$git_remote_name];then# The remote already exists;# TODO: Update it if it has changed.echo"skipping $u" >&2else git remote add -t master -m master $git_remote_name$git_urlfifidone