@@ -114,15 +114,15 @@ error_cai()
114
114
error_car ()
115
115
{
116
116
RETURN=" $? "
117
- echo " $ECHO_PREFIX ${YELLOW} Warning ${CYAN}${IMAGE}${YELLOW} container already running. ${RESET} "
118
- echo " Look for possible fixes here: ${CYAN} http://wplib.github.io/wplib-box/errors/W017/${RESET} "
117
+ echo " $ECHO_PREFIX ${GREEN} Container already running: ${CYAN}${IMAGE}${RESET} "
118
+ # echo "Look for possible fixes here: ${CYAN}http://wplib.github.io/wplib-box/errors/W017/${RESET}"
119
119
return $RETURN
120
120
}
121
121
122
122
error_cas ()
123
123
{
124
124
RETURN=" $? "
125
- echo " $ECHO_PREFIX ${CYAN}${IMAGE }${GREEN} container already stopped. ${RESET} "
125
+ echo " $ECHO_PREFIX ${GREEN} Container already stopped: ${CYAN }${IMAGE} ${RESET}"
126
126
# echo "Look for possible fixes here: ${CYAN}http://wplib.github.io/wplib-box/errors/W018/${RESET}"
127
127
return $RETURN
128
128
}
@@ -452,15 +452,20 @@ d_start()
452
452
then
453
453
error_car
454
454
else
455
- echo " $ECHO_PREFIX ${GREEN} Starting container: ${CYAN}${IMAGE}${RESET} "
456
- docker start ${CONTAINER_NAME}
455
+ echo -n " $ECHO_PREFIX ${GREEN} Starting container: ${CYAN}${IMAGE}${RESET} ... "
456
+ TEMPFILE=" ` mktemp /tmp/box-container.XXX` "
457
+ docker start ${CONTAINER_NAME} >& $TEMPFILE
458
+
457
459
if [ " $? " == " 1" ]
458
460
then
459
461
echo " ${RED} NOT OK${RESET} "
460
462
error_ccbs
463
+ cat $TEMPFILE
461
464
else
462
465
echo " ${GREEN} OK${RESET} "
463
466
fi
467
+
468
+ rm -f $TEMPFILE
464
469
fi
465
470
;;
466
471
@@ -476,7 +481,6 @@ d_start()
476
481
error_pns
477
482
;;
478
483
esac
479
- echo " "
480
484
481
485
return $RETURN
482
486
}
@@ -492,15 +496,20 @@ d_stop()
492
496
then
493
497
error_cas
494
498
else
495
- echo " $ECHO_PREFIX ${GREEN} Stopping container: ${CYAN}${IMAGE}${RESET} "
496
- docker stop ${CONTAINER_NAME}
499
+ echo -n " $ECHO_PREFIX ${GREEN} Stopping container: ${CYAN}${IMAGE}${RESET} ... "
500
+ TEMPFILE=" ` mktemp /tmp/box-container.XXX` "
501
+ docker stop ${CONTAINER_NAME} >& $TEMPFILE
502
+
497
503
if [ " $? " == " 1" ]
498
504
then
499
505
echo " ${RED} NOT OK${RESET} "
500
506
error_ccbd
507
+ cat $TEMPFILE
501
508
else
502
509
echo " ${GREEN} OK${RESET} "
503
510
fi
511
+
512
+ rm -f $TEMPFILE
504
513
fi
505
514
;;
506
515
@@ -516,22 +525,26 @@ d_stop()
516
525
error_pns
517
526
;;
518
527
esac
519
- echo " "
520
528
521
529
return $RETURN
522
530
}
523
531
524
532
525
533
d_shutdown ()
526
534
{
527
- echo " $ECHO_PREFIX ${GREEN} Stopping all WPLLib containers${RESET} "
528
- docker container ls -qaf " label=container.project=${DEFAULT_PROJECT} " | xargs docker stop
535
+ echo " $ECHO_PREFIX ${GREEN} Stopping all WPLLib containers${RESET} ... "
536
+ TEMPFILE=" ` mktemp /tmp/box-container.XXX` "
537
+ docker container ls -qaf " label=container.project=${DEFAULT_PROJECT} " | xargs docker stop >& $TEMPFILE
529
538
if [ " $? " == " 1" ]
530
539
then
540
+ echo " ${RED} NOT OK${RESET} "
531
541
error_csac
542
+ cat $TEMPFILE
532
543
return 1
533
544
fi
534
545
546
+ rm -f $TEMPFILE
547
+
535
548
return $RETURN_OK
536
549
}
537
550
0 commit comments