Skip to content

Commit b9f4567

Browse files
committed
Attempt to run command to fix permissions
1 parent fde416c commit b9f4567

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cmd/elastic.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ function elastic_start(){
1818

1919
# check permissions, and if $DOCKER_USER cannot read the data dir, quit with error
2020
if [[ "$desired_owner_uid" != "$elasticsearch_owner_uid" ]]; then
21-
echo "user $DOCKER_USER cannot access elasticsearch directory at $DATA_DIR"
22-
echo "please run 'sudo chown $DOCKER_USER $DATA_DIR/elasticsearch'"
23-
exit 1
21+
cmd="sudo chown $DOCKER_USER $DATA_DIR/elasticsearch"
22+
echo "User $DOCKER_USER cannot access elasticsearch directory at $DATA_DIR"
23+
echo "attempting to fix permissins by running '$cmd'. You may be asked for your password."
24+
$cmd
2425
fi
2526
compose_exec up -d elasticsearch
2627
}

0 commit comments

Comments
 (0)