From: Dan Mick Date: Fri, 8 Mar 2013 23:18:54 +0000 (-0800) Subject: ceph_common.sh: add warning if 'host' contains dots X-Git-Tag: v0.59~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7aa897ce012b24fe73e891a39901366cf2b58a1;p=ceph.git ceph_common.sh: add warning if 'host' contains dots This is a common error and there's no reason the script can't at least tell you it's a really bad idea. One might argue it could even successfully proactively truncate the host parameter at the first dot, but that's a little controlling, perhaps. Signed-off-by: Dan Mick Reviewed-by: Josh Durgin --- diff --git a/src/ceph_common.sh b/src/ceph_common.sh index 4851a785e8f8..76af12979211 100644 --- a/src/ceph_common.sh +++ b/src/ceph_common.sh @@ -38,6 +38,11 @@ check_host() { echo "$0: use a proper short hostname (hostname -s), not 'localhost', in $conf section $type.$id; skipping entry" return 1 fi + if expr match "$host" '.*\.' > /dev/null 2>&1; then + echo "$0: $conf section $type.$id" + echo "contains host=$host, which contains dots; this is probably wrong" + echo "It must match the result of hostname -s" + fi ssh="" rootssh="" sshdir=$PWD