Skip to content

Commit 88cab55

Browse files
author
Rob Holland
committed
Don't rely on a port for status.
Not all dokku apps use a port.
1 parent c07312e commit 88cab55

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎plugins/apps/commands‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ case "$1" in
2121
verify_app_name "$2"
2222
verify_max_args 2 "$@"
2323

24-
if docker port "$APP_NAME" "$APP_PORT" 1>/dev/null 2>/dev/null
25-
then
24+
if [ $(docker inspect --format="{{ .State.Running }}" "$APP_NAME") = "true" ]; then
2625
echo "$APP is running."
2726
else
2827
echo "$APP is stopped."
@@ -32,14 +31,14 @@ case "$1" in
3231
apps:start|start)
3332
verify_app_name "$2"
3433
verify_max_args 2 "$@"
35-
34+
3635
docker start "$APP_NAME"
3736
;;
3837

3938
apps:stop|stop)
4039
verify_app_name "$2"
4140
verify_max_args 2 "$@"
42-
41+
4342
docker stop "$APP_NAME"
4443
;;
4544

@@ -74,7 +73,7 @@ case "$1" in
7473
apps:top|top)
7574
verify_app_name "$2"
7675
verify_max_args 2 "$@"
77-
76+
7877
shift 2
7978
docker top "$APP_NAME"
8079
;;

0 commit comments

Comments
 (0)