Skip to content

Commit

Permalink
Attempt to run command to fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
orangejulius committed Sep 15, 2020
1 parent fde416c commit b9f4567
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/elastic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ function elastic_start(){

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

0 comments on commit b9f4567

Please sign in to comment.