-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init
16 lines (13 loc) · 598 Bytes
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
set -e
SHARE_DIR=/share/nextcloud
if [ ! -d "${SHARE_DIR}" ]; then
mkdir -p "${SHARE_DIR}"
chown -R www-data:root "${SHARE_DIR}"
chmod -R g=u "${SHARE_DIR}"
fi
CONFIG_PATH=/data/options.json
echo 'Starting with the following configuration:';
jq --raw-output 'keys[] as $k | select(.[$k] != "" and .[$k] != null) | "\t" + ($k | ascii_upcase) + "=\"" + (.[$k]|tostring) + "\""' $CONFIG_PATH;
eval $(jq --raw-output 'keys[] as $k | select(.[$k] != "" and .[$k] != null) | "export " + ($k | ascii_upcase) + "=\"" + (.[$k]|tostring) + "\""' $CONFIG_PATH);
/entrypoint.sh "$@"