changeset 260:6aecbb32c587

fix script to not start stopped containers
author aldrich@nwoca.org
date Thu, 12 Jul 2018 16:04:09 +0100
parents 95c897db1e67
children 48e1e28e7d14 74ba1fec18f3
files scripts/updates-apply.sh
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/updates-apply.sh	Tue Jun 19 17:27:58 2018 +0100
+++ b/scripts/updates-apply.sh	Thu Jul 12 16:04:09 2018 +0100
@@ -12,7 +12,7 @@
 #
 # examples:
 #   /ssdt/apply-updates.sh /data/preview
-#   /ssdt/apply-updates.sh /data/preview usps
+#   /ssdt/apply-updates.sh /data/preview uspsapp
 #
 
 source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh"
@@ -34,12 +34,15 @@
       read  container eol <<< $line
       if [[ $container == *_1 ]]
       then
-        t=(${container//_/ })
-        service=${t[1]}
-        if [[ $service == $SERVICE ]]
+        if [[ $eol =~ "Up" ]]
         then
-           echo -e "\n$project: Updating $service"
-           docker-compose up -d $service
+           t=(${container//_/ })
+           service=${t[1]}
+           if [[ $service == $SERVICE ]]
+           then
+             echo -e "\n$project: Updating $service"
+             docker-compose up -d $service
+           fi
         fi
       fi
    done < <(docker-compose ps)