make the successful run output end with more clear messages.
By moving them outside of the "do it all" path, the xtrace output
will not mix with echo statements.
| ... | ... |
@@ -654,6 +654,16 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then |
| 654 | 654 |
|
| 655 | 655 |
fi |
| 656 | 656 |
|
| 657 |
+# Fin |
|
| 658 |
+# === |
|
| 659 |
+ |
|
| 660 |
+ |
|
| 661 |
+) 2>&1 | tee "${LOGFILE}"
|
|
| 662 |
+ |
|
| 663 |
+# Check that the left side of the above pipe succeeded |
|
| 664 |
+for ret in "${PIPESTATUS[@]}"; do [ $ret -eq 0 ] || exit $ret; done
|
|
| 665 |
+ |
|
| 666 |
+( |
|
| 657 | 667 |
# Using the cloud |
| 658 | 668 |
# =============== |
| 659 | 669 |
|
| ... | ... |
@@ -671,19 +681,7 @@ if [[ "$ENABLED_SERVICES" =~ "key" ]]; then |
| 671 | 671 |
echo "the password: $ADMIN_PASSWORD" |
| 672 | 672 |
fi |
| 673 | 673 |
|
| 674 |
-# Fin |
|
| 675 |
-# === |
|
| 676 |
- |
|
| 677 |
- |
|
| 678 |
-) 2>&1 | tee "${LOGFILE}"
|
|
| 679 |
- |
|
| 680 |
-# because of the way pipes work, the left side of the pipe may |
|
| 681 |
-# have failed, but 'tee' will succeed. We need to check that. |
|
| 682 |
-for ret in "${PIPESTATUS[@]}"; do
|
|
| 683 |
- [ $ret -eq 0 ] || exit $ret |
|
| 684 |
-done |
|
| 685 |
- |
|
| 686 | 674 |
# indicate how long this took to run (bash maintained variable 'SECONDS') |
| 687 |
-echo "stack.sh completed in $SECONDS seconds." | tee -a "${LOGFILE}"
|
|
| 675 |
+echo "stack.sh completed in $SECONDS seconds." |
|
| 688 | 676 |
|
| 689 |
-exit 0 |
|
| 677 |
+) | tee -a "$LOGFILE" |