5 # Configure a simple NAS cluster as generated by autocluster..
9 conf_file="/root/scripts/nas.conf"
11 ad_admin_pass="$AD_ADMIN_PASS"
12 domain_auth="administrator${ad_admin_pass:+%}${ad_admin_pass}"
16 local timeout="${1:-120}"
18 echo -n "Wait until healthy [<${timeout}] "
21 while [ $count -lt $timeout ] ; do
22 if ctdb nodestatus all >/dev/null ; then
35 auth_type=$(sed -r -n -e 's@^auth_method[[:space:]]*=[[:space:]]*(files|winbind)[[:space:]]*$@\1@p' "$conf_file")
40 net ads join -U"$domain_auth"
44 echo "Restarting ctdb (up to 5 times)"
45 # Just in case the cluster doesn't become healthy the first time,
46 # repeat a few times...
47 for i in $(seq 1 5) ; do
48 onnode -p all "service ctdb restart"
49 if wait_until_healthy ; then
50 echo "NAS cluster setup complete"