diff options
author | Dan McGee <dan@archlinux.org> | 2009-09-14 01:25:14 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-09-14 01:25:14 +0200 |
commit | ade48254bbe2ee2cedc7773dd5299fa2208f66ca (patch) | |
tree | ec92888e41081e35ab5f6943a3e2856519086b91 /db-update | |
parent | 0897913c0adf10a0a9ff4d8790842715e0e3b1b4 (diff) | |
download | dbscripts-ade48254bbe2ee2cedc7773dd5299fa2208f66ca.tar.gz dbscripts-ade48254bbe2ee2cedc7773dd5299fa2208f66ca.tar.xz |
Ensure you don't update DBs on the wrong server
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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="" |