forked from haijeploeg/excludarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
55 lines (47 loc) · 1.42 KB
/
entrypoint.sh
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/bash
general_fast_search="${GENERAL_FAST_SEARCH:-true}"
general_locale="${GENERAL_LOCALE:-en_US}"
general_providers="[${GENERAL_PROVIDERS:-'netflix'}]"
tmdb_api_key="${TMDB_API_KEY}"
radarr_url="${RADARR_URL:-http://localhost:7878}"
radarr_api_key="${RADARR_API_KEY:-secret}"
radarr_verify_ssl="${RADARR_VERIFY_SSL:-false}"
radarr_exclude="[${RADARR_EXCLUDE:-''}]"
sonarr_url="${SONARR_URL:-http://localhost:8989}"
sonarr_api_key="${SONARR_API_KEY:-secret}"
sonarr_verify_ssl="${SONARR_VERIFY_SSL:-false}"
sonarr_exclude="[${SONARR_EXCLUDE:-''}]"
cron_mode="${CRON_MODE:-false}"
cat << EOF > /etc/excludarr/excludarr.yml
general:
fast_search: $general_fast_search
locale: $general_locale
providers: $general_providers
radarr:
url: '$radarr_url'
api_key: '$radarr_api_key'
verify_ssl: $radarr_verify_ssl
exclude: $radarr_exclude
sonarr:
url: '$sonarr_url'
api_key: '$sonarr_api_key'
verify_ssl: $sonarr_verify_ssl
exclude: $sonarr_exclude
EOF
if [[ ! -z $TMDB_API_KEY ]]; then
cat << EOF >> /etc/excludarr/excludarr.yml
tmdb:
api_key: '$tmdb_api_key'
EOF
fi
if [ "$cron_mode" = true ]; then
if test -f "/etc/excludarr/crontab"; then
cp /etc/excludarr/crontab /var/spool/cron/crontabs/root
crond -l 8 -f
else
echo "No crontab file mounted! Please mount a valid crontab file at /etc/excludarr/crontab before running in cron mode!"
exit 1
fi
else
excludarr $@
fi