Skip to content

Commit

Permalink
Fix entrypoint.sh creating one folder named {plugins,embedded-db}
Browse files Browse the repository at this point in the history
Summary:
To allow spaces in variables like OPENFIRE_DATA_DIR, they have been enclosed
in quotes.

As the expression uses GNU coreutils mkdir {} syntax, put the {} in quotes
has broken the directory creation: instead to create /path/to/openfire/plugins
and /path/to/openfire/embedded-db, it created the exact quoted content.

That breaks new installations when directories don't exist.

This change fixes that regression. This is a follow-up for e76b3cf.

Test Plan:
```
$ export OPENFIRE_DATA_DIR=/tmp/openfire
$ mkdir -p "${OPENFIRE_DATA_DIR}"/{plugins,embedded-db}
$ ls $OPENFIRE_DATA_DIR
embedded-db  plugins
```

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D2372
  • Loading branch information
bdelcamp authored and dereckson committed Oct 14, 2020
1 parent 57e7115 commit f5f19ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ initialize_data_dir() {
if [[ ! -d "${OPENFIRE_DATA_DIR}/conf" ]]; then
sudo -HEu "${OPENFIRE_USER}" cp -a /etc/openfire "${OPENFIRE_DATA_DIR}/conf"
fi
sudo -HEu "${OPENFIRE_USER}" mkdir -p "${OPENFIRE_DATA_DIR}/{plugins,embedded-db}"
sudo -HEu "${OPENFIRE_USER}" mkdir -p "${OPENFIRE_DATA_DIR}"/{plugins,embedded-db}
sudo -HEu "${OPENFIRE_USER}" rm -rf "${OPENFIRE_DATA_DIR}/plugins/admin"
sudo -HEu "${OPENFIRE_USER}" ln -sf /usr/share/openfire/plugin-admin /var/lib/openfire/plugins/admin

Expand Down

0 comments on commit f5f19ab

Please sign in to comment.