Skip to content

Commit

Permalink
docker executable: only chown existing folders
Browse files Browse the repository at this point in the history
  • Loading branch information
jstriebel authored Dec 13, 2017
1 parent c6349ef commit 5f608ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fossildb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ set -Eeuo pipefail
FOSSILDB_HOME=$(dirname $(readlink -f $0))

if [ "$(id -u)" = '0' ]; then
chown -R fossildb $FOSSILDB_HOME/data $FOSSILDB_HOME/backup
for SUBDIR in data backup; do
DIR=$FOSSILDB_HOME/$SUBDIR
if [ -d "$DIR" ]; then
chown -R fossildb $DIR
fi
done
exec gosu fossildb java -jar $FOSSILDB_HOME/fossildb.jar $@
else
exec java -jar $FOSSILDB_HOME/fossildb.jar $@
Expand Down

0 comments on commit 5f608ea

Please sign in to comment.