From 6b4977d8a4d09a002261379ebd04bf5718dac104 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 17 Oct 2016 17:18:33 +1100 Subject: Run net ads join under a timeout and exit if join fails Signed-off-by: Amitay Isaacs --- base/all/root/scripts/tasks/setup_cluster_nas.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/all/root/scripts/tasks/setup_cluster_nas.sh b/base/all/root/scripts/tasks/setup_cluster_nas.sh index d970118..5635757 100755 --- a/base/all/root/scripts/tasks/setup_cluster_nas.sh +++ b/base/all/root/scripts/tasks/setup_cluster_nas.sh @@ -37,7 +37,8 @@ auth_type=$(sed -r -n -e 's@^auth_method[[:space:]]*=[[:space:]]*(files|winbind) case "$auth_type" in winbind) echo "Joining domain" - net ads join -U"$domain_auth" + timeout 10 net ads join -U"$domain_auth" || \ + { echo "Domain join failed"; exit 1; } ;; esac -- cgit