diff options
author | Amitay Isaacs <amitay@gmail.com> | 2016-11-10 13:48:52 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2016-11-10 13:48:52 +1100 |
commit | 39e90befd944206d7372b44451bacf95f6445be6 (patch) | |
tree | cacb717e0c30dfb9a2158a4477d8b48f46dc2bbb | |
parent | dabaa298002ae89aeb5993ba5ac05976dfce750c (diff) | |
download | autocluster-39e90befd944206d7372b44451bacf95f6445be6.tar.gz autocluster-39e90befd944206d7372b44451bacf95f6445be6.tar.xz autocluster-39e90befd944206d7372b44451bacf95f6445be6.zip |
Try 5 times to join AD domain before failing
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
-rwxr-xr-x | base/all/root/scripts/tasks/setup_cluster_nas.sh | 11 |
1 files 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 |