From 39e90befd944206d7372b44451bacf95f6445be6 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 10 Nov 2016 13:48:52 +1100 Subject: Try 5 times to join AD domain before failing Signed-off-by: Amitay Isaacs --- base/all/root/scripts/tasks/setup_cluster_nas.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/base/all/root/scripts/tasks/setup_cluster_nas.sh b/base/all/root/scripts/tasks/setup_cluster_nas.sh index 5635757..d584e5a 100755 --- a/base/all/root/scripts/tasks/setup_cluster_nas.sh +++ b/base/all/root/scripts/tasks/setup_cluster_nas.sh @@ -37,8 +37,15 @@ auth_type=$(sed -r -n -e 's@^auth_method[[:space:]]*=[[:space:]]*(files|winbind) case "$auth_type" in winbind) echo "Joining domain" - timeout 10 net ads join -U"$domain_auth" || \ - { echo "Domain join failed"; exit 1; } + for i in $(seq 1 5) ; do + status=0 + timeout 10 net ads join -U"$domain_auth" || status=$? + echo " status = $status" + if [ $status -eq 0 ] ; then + break + fi + sleep 1 + done ;; esac -- cgit