Run net ads join under a timeout and exit if join fails
authorAmitay Isaacs <amitay@gmail.com>
Mon, 17 Oct 2016 06:18:33 +0000 (17:18 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 18 Oct 2016 01:15:57 +0000 (12:15 +1100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
base/all/root/scripts/tasks/setup_cluster_nas.sh

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