From c0f78591f828d2920e340e35c7ebcc6da0cd59e9 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Wed, 27 Nov 2013 13:11:07 +0100 Subject: check if repo is set --- addhost | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'addhost') diff --git a/addhost b/addhost index 033c16b..988cf19 100755 --- a/addhost +++ b/addhost @@ -37,6 +37,11 @@ defrepo=`git remote -v | grep ${remote:="ro"} | grep fetch | awk '{print $2}'` rrepo=${repo:="$defrepo"} rtag=${tag:="changeme"} +if [ "x$rrepo" = "x" ]; then + echo "$0: repo not set in cosmos.conf and no git branch named 'ro' found" + exit 1 +fi + if [ ! -d $cmd_hostname ]; then cp -pr default $cmd_fqdn git add $cmd_fqdn -- cgit v1.1