-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit
executable file
·69 lines (58 loc) · 1.53 KB
/
init
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
set -e
usermod -d $APPDIR www-data
mkdir -p $APPDIR/.ssh/
if [ -e /etc/persistent-conf/ssh/id_rsa ]; then
cp -f /etc/persistent-conf/ssh/id_rsa $APPDIR/.ssh/id_rsa
chmod 600 $APPDIR/.ssh/id_rsa
fi
if [ -e /etc/persistent-conf/ssh/known_hosts ]; then
cp -f /etc/persistent-conf/ssh/known_hosts $APPDIR/.ssh/known_hosts
fi
chown -R www-data:www-data $APPDIR/.ssh
chmod 700 $APPDIR/.ssh
chown www-data:www-data $APPDIR/storage
_start() {
if [ -S /dev/log ]; then
cat /setup/config/thumbor-syslog.conf >> /etc/thumbor.conf
fi
if [ -f /etc/persistent-conf/thumbor.conf ]; then
cat /etc/persistent-conf/thumbor.conf >> /etc/thumbor.conf
fi
echo "Starting thumbor..."
sudo -u www-data -H \
PYTHON_EGG_CACHE=/srv/thumbor/.egg-cache \
"$(which thumbor)"
}
_help () {
echo "Available options:"
echo " start - Starts the thumbor server (default)"
echo " help - Displays this help"
echo " [command] - Execute a the specified shell command."
}
if [ -z "$1" ]; then
_start
else
case "$1" in
start)
_start
;;
help)
_help
;;
*)
if [ -x $1 ]; then
$1
else
prog=$(which $1)
if [ -n "${prog}" ] ; then
shift 1
$prog $@
else
echo "Not found: $1"
exit 1
fi
fi
;;
esac
fi