Try 5 times to join AD domain before failing
authorAmitay Isaacs <amitay@gmail.com>
Thu, 10 Nov 2016 02:48:52 +0000 (13:48 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 10 Nov 2016 02:48:52 +0000 (13:48 +1100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
base/all/root/scripts/tasks/setup_cluster_nas.sh

index 5635757ddb0823ce568f3cde25d4f8bc4539aadb..d584e5a9892ac1858789685e4419642d997b33a1 100755 (executable)
@@ -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