create_cluster: Avoid -e exit when cluster isn't in hosts file
authorMartin Schwenke <martin@meltin.net>
Tue, 17 Jun 2014 04:40:18 +0000 (14:40 +1000)
committerMartin Schwenke <martin@meltin.net>
Wed, 25 Jun 2014 10:46:15 +0000 (20:46 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
examples/create_cluster.sh

index c030bf7..fcac626 100755 (executable)
@@ -48,7 +48,7 @@ update_hosts_file ()
     pat="# autocluster ${cluster}\$|[[:space:]]${cluster}(n|base)[[:digit:]]+"
 
     t="/etc/hosts.${cluster}"
-    grep -E "$pat" /etc/hosts >"$t"
+    grep -E "$pat" /etc/hosts >"$t" || true
     if diff -B "$t" "tmp/hosts.${cluster}" >/dev/null ; then
 rm "$t"
 return