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 d970118..5635757 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