-
Notifications
You must be signed in to change notification settings - Fork 0
/
init
55 lines (46 loc) · 1.17 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
#!/bin/sh
# set UID and GID
PUID=${PUID:-911}
PGID=${PGID:-911}
echo '
-------------------------------------
GID/UID
-------------------------------------'
echo "
User uid: $PUID
User gid: $PGID
-------------------------------------
"
# set permissions
chown ${PUID}:${PGID} /defaults
# set timezone
echo "Setting timezone to $TZ."
cp -f "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "${TZ}" > /etc/timezone
# lock file cleanup
rm -f /config/.config-lock 2>/dev/null
# default config
if [ ! -f /config/config.yml ]; then
cp -f /defaults/config.yml /config/config.yml
fi
# permissions
chown -R ${PUID}:${PGID} /config
if [ -d /data/downloads/flexget ]; then
chown ${PUID}:${PGID} /data/downloads/flexget
fi
# set flexget version to install
case ${VERSION} in
latest)
echo "Updating to latest version of FlexGet."
pip install -U flexget
;;
docker)
echo "Checking FlexGet version..."
flexget -V
;;
*)
echo "Installing FlexGet $VERSION."
pip install -U "flexget==${VERSION}"
;;
esac
su-exec ${PUID}:${PGID} /usr/local/bin/flexget -c /config/config.yml \
--logfile ${LOG_FILE} --loglevel ${LOG_LEVEL} daemon start --autoreload-config