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