change partitioning to use lvm, refactor for fsf server
[automated-distro-installer] / chost
diff --git a/chost b/chost
index a26529fee9efbeaf3a14632946d59d4e84d7bc8d..204637b003852d21d7c661b966f41e9a69d73ae5 100755 (executable)
--- a/chost
+++ b/chost
@@ -11,5 +11,13 @@ host=$1
 # a valid address and we just use that
 addr=$(host $host | sed -rn 's/^\S+ has address //p;T;q' ||:)
 h=$(host $addr)
+case $h in
+  *"no PTR record")
+    echo "error: chost: $h" >&2
+    exit 1
+    ;;
+esac
 h=${h##* }
+# trailing dot in a hostname will mess up rsync
+h=${h%.}
 echo $h