diff options
Diffstat (limited to 'dropbox/entrypoint.sh')
-rwxr-xr-x | dropbox/entrypoint.sh | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/dropbox/entrypoint.sh b/dropbox/entrypoint.sh deleted file mode 100755 index 596cac6..0000000 --- a/dropbox/entrypoint.sh +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | DATA_DIR="/srv/dropbox/data" | ||
6 | CFG_DIR="/srv/dropbox/config" | ||
7 | USERNAME="dropbox" | ||
8 | |||
9 | # Default UID/GID to owner of the data directory | ||
10 | USER_UID=${USER_UID:-$(stat -L -c "%u" $DATA_DIR)} | ||
11 | USER_GID=${USER_GID:-$(stat -L -c "%u" $DATA_DIR)} | ||
12 | |||
13 | if [ "$USER_GID" = 0 -o "$USER_GID" = 0 ]; then | ||
14 | echo "User UID/GID could not be discovered, is $DATA_DIR mounted?" | ||
15 | exit 1 | ||
16 | fi | ||
17 | |||
18 | # Create the user and group | ||
19 | addgroup -g ${USER_GID} -S ${USERNAME} | ||
20 | adduser -u ${USER_UID} -h /home/${USERNAME} -D -G ${USERNAME} ${USERNAME} | ||
21 | |||
22 | ln -s /srv/dropbox/data /home/${USERNAME}/Dropbox | ||
23 | ln -s /srv/dropbox/config /home/${USERNAME}/.dropbox | ||
24 | |||
25 | # Allow runsv to write its superisory files for the main process | ||
26 | mkdir /opt/dropbox-srv/supervise | ||
27 | chown dropbox:dropbox /opt/dropbox-srv/supervise | ||
28 | |||
29 | # Allow runsv to write its superisory files for the log process | ||
30 | mkdir /opt/dropbox-srv/log/supervise | ||
31 | chown dropbox:dropbox /opt/dropbox-srv/log/supervise | ||
32 | |||
33 | if [ "$@" == "/bin/sh" ]; then | ||
34 | exec "$@" | ||
35 | else | ||
36 | exec /usr/bin/dumb-init -c /sbin/su-exec ${USERNAME} "$@" | ||
37 | fi | ||