| @@ -31,6 +31,12 @@ if [ -z $host ]; then | |||
| echo "No host found!"; | |||
| exit 1; | |||
| fi | |||
| # add avahi suffix | |||
| localhostname=$(cat /etc/hostname) | |||
| if [ "${localhostname}" != "${host}" ]; then | |||
| host=${host}.local | |||
| fi | |||
| container=$(ssh $host 'docker ps | grep pihole | cut -f1 -d" "') | |||
| #echo Container=$container | |||
| if [ -z $container ]; then | |||
| @@ -15,6 +15,12 @@ if [ -z $host ]; then | |||
| echo "No host found!"; | |||
| exit 1; | |||
| fi | |||
| # add avahi suffix | |||
| localhostname=$(cat /etc/hostname) | |||
| if [ "${localhostname}" != "${host}" ]; then | |||
| host=${host}.local | |||
| fi | |||
| container=$(ssh $host 'docker ps | grep openldap | cut -f1 -d" "') | |||
| #echo Container=$container | |||
| if [ -z $container ]; then | |||
| @@ -52,6 +52,12 @@ while [ $NC_UP -eq 0 ]; do | |||
| echo "No host found!"; | |||
| continue; | |||
| fi | |||
| # add avahi suffix | |||
| localhostname=$(cat /etc/hostname) | |||
| if [ "${localhostname}" != "${host}" ]; then | |||
| host=${host}.local | |||
| fi | |||
| container=$(ssh $host 'docker ps | grep '${SERVICE}' | cut -f1 -d" "') | |||
| #echo Container=$container | |||
| if [ -z $container ]; then | |||
| @@ -17,6 +17,12 @@ if [ -z $host ]; then | |||
| echo "No host found!"; | |||
| exit 1; | |||
| fi | |||
| # add avahi suffix | |||
| localhostname=$(cat /etc/hostname) | |||
| if [ "${localhostname}" != "${host}" ]; then | |||
| host=${host}.local | |||
| fi | |||
| container=$(ssh $host 'docker ps | grep '${SERVICE}' | cut -f1 -d" "') | |||
| #echo Container=$container | |||
| if [ -z $container ]; then | |||
| @@ -57,7 +57,7 @@ echo "Checking workers mounted volumes" | |||
| echo `docker node ls --filter role=worker --format "{{.Hostname}} {{.Status}} {{.Availability}}" | grep "Ready Active" | cut -f 1 -d ' '` | |||
| for node in `docker node ls --filter role=worker --format "{{.Hostname}} {{.Status}} {{.Availability}}" | grep "Ready Active" | cut -f 1 -d ' '`; do | |||
| echo "Checking volumes on $node" | |||
| ssh $node "mount | grep volumes || mount /media/volumes" | |||
| ssh ${node}.local "mount | grep volumes || mount /media/volumes" | |||
| done | |||
| # restart stack | |||
| @@ -69,7 +69,7 @@ sleep 120 | |||
| # add users | |||
| # in case it's not ready yet, try 5 times | |||
| for i in $(seq 1 5); do | |||
| echo "Attempt 1"; | |||
| echo "Adding users - Attempt $i"; | |||
| ./add_users.sh ${STACK_NAME}; | |||
| if [ $? -eq 0 ]; then | |||
| break; | |||