cx-conndev: afficher les erreurs

This commit is contained in:
Jephté Clain 2019-05-24 11:49:11 +04:00
parent 7524a2869a
commit cbb34ecd3f
1 changed files with 8 additions and 3 deletions

View File

@ -44,10 +44,15 @@ fi
###
setx cid=docker-compose ps -q "$service" 2>/dev/null || die "$service: service introuvable"
function die_not_found() { die "$service: service introuvable"; }
setx cid=docker-compose ps -q "$service" 2>/dev/null || die_not_found
[ -n "$cid" ] || die_not_found
edebug "$service id: $cid"
setx ip=docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$cid"
edebug "$service: $ip"
function die_not_found() { die "$service: $cid: ip introuvable"; }
setx ip=docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$cid" || die_not_found
[ -n "$ip" ] || die_not_found
edebug "$service ip: $ip"
mysqlcmd="$(php bin/conndev.php "$ip" "$@")"
edebug "mysqlcmd: $mysqlcmd"