-
Notifications
You must be signed in to change notification settings - Fork 3
/
dropbox
executable file
·38 lines (33 loc) · 961 Bytes
/
dropbox
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
#---------------------------------------------------------------------
# dropbox-cli support script
#---------------------------------------------------------------------
# Usage from host :
# $ docker exec -it <CONTAINER_NAME> /dropbox <command>
#
# for more details
#
# $ docker exec -it <CONTAINER_NAME> /dropbox help
#
DBOX_USER=dbox
DBOX_HOME=/home/${DBOX_USER}
if [ $1 = running-status ]; then
PID_FILE=${DBOX_HOME}/.dropbox/dropbox.pid
if [ -f $PID_FILE ]; then
DBOX_PID=`cat ${DBOX_HOME}/.dropbox/dropbox.pid`
if [ -n "$DBOX_PID" ]; then
cat /proc/${DBOX_PID}/cmdline | grep -q '/dropbox'
exit $?
fi
fi
exit 1
fi
which su-exec > /dev/null 2>&1 && EXEC=su-exec
which gosu > /dev/null 2>&1 && EXEC=gosu
if [ -z $EXEC ]; then
echo "[Fatal] Neither su-exec nor gosu are installed." >&2
exit 1
fi
${EXEC} ${DBOX_USER} ${DBOX_HOME}/bin/dropbox.py $@
exit $?
# vim: ts=2 sw=2 sts=2 et nu foldmethod=marker