Skip to content

Commit 5a10e52

Browse files
authored
Merge pull request #19 from universityofadelaide/feature/18-specific-grep
Make the grep more specific.
2 parents f9e76bd + 34c94f5 commit 5a10e52

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dsh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Connecting via ./dsh shell and running robo build is a common next step."
6363
# Command: ./dsh shell
6464
# Connects a shell to the web image as the current user.
6565
dsh_shell() {
66-
if ! docker ps | grep ${PROJECT}_web_1 > /dev/null; then
66+
if ! docker ps | grep "\s${PROJECT}_web_1" > /dev/null; then
6767
notice "Project not running, starting."
6868
dsh_start
6969
fi
@@ -97,7 +97,7 @@ dsh_shell() {
9797
dsh_stop() {
9898
notice "Stopping containers."
9999
docker-compose stop
100-
if docker network ls | grep ${PROJECT}_default > /dev/null; then
100+
if docker network ls | grep "\s${PROJECT}_default" > /dev/null; then
101101
notice "Disconnecting nginx proxy from network."
102102
set +e
103103
docker network disconnect ${PROJECT}_default nginx-proxy
@@ -128,7 +128,7 @@ dsh_status() {
128128
# Command: ./dsh logs
129129
# Tails logs from web container.
130130
dsh_logs() {
131-
if docker ps | grep ${PROJECT}_web_1 > /dev/null; then
131+
if docker ps | grep "\s${PROJECT}_web_1" > /dev/null; then
132132
docker logs --follow --tail 1 ${PROJECT}_web_1
133133
fi
134134
}
@@ -204,7 +204,7 @@ setup_ssh_agent_proxy() {
204204
}
205205

206206
setup_docker_network() {
207-
if ! docker network ls | grep ${PROJECT}_default > /dev/null; then
207+
if ! docker network ls | grep "\s${PROJECT}_default" > /dev/null; then
208208
notice "Creating docker network for project."
209209
docker network create ${PROJECT}_default
210210
fi

0 commit comments

Comments
 (0)