From ade48254bbe2ee2cedc7773dd5299fa2208f66ca Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 13 Sep 2009 18:25:14 -0500 Subject: Ensure you don't update DBs on the wrong server Signed-off-by: Dan McGee --- db-update | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'db-update') diff --git a/db-update b/db-update index 577a028..aa1cb95 100755 --- a/db-update +++ b/db-update @@ -11,7 +11,18 @@ fi reponame="$1" current_arch="" -[ "$UID" = "" ] && UID=$(uid) +# ensure we should be playing with this DB on this server +repos="$(get_repos_for_host)" +found=0 +for r in $repos; do + if [ "$r" = "$reponame" ]; then + found=1 + fi +done +if [ $found -ne 1 ]; then + echo "error: you shouldn't be updating $reponame on this server!" + exit 1 +fi WORKDIR="$TMPDIR/db-update.$reponame.$UID" ADDPKGS="" -- cgit v1.2.3-24-g4f1b