File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,19 @@ CRON_TIMER=${CRON_TIMER:-"*/5 * * * *"}
5
5
6
6
PYTHON_PATH=$( which python)
7
7
8
- # Create the cron job with the environment variable
9
- echo " $CRON_TIMER $PYTHON_PATH /app/cloudflare_updater.py >> /var/log/cron.log 2>&1" > /etc/cron.d/cloudflare-cron
8
+ # Create the cron job with all the required environment variables
9
+ cat > /etc/cron.d/cloudflare-cron << EOF
10
+ CF_API_KEY=$CF_API_KEY
11
+ CF_EMAIL=$CF_EMAIL
12
+ CF_ZONE_ID=$CF_ZONE_ID
13
+ CF_RECORD_ID=$CF_RECORD_ID
14
+ CF_RECORD_NAME=$CF_RECORD_NAME
15
+ CF_RECORD_TYPE=$CF_RECORD_TYPE
16
+ CF_TTL=$CF_TTL
17
+ CF_PROXIED=$CF_PROXIED
18
+
19
+ $CRON_TIMER root $PYTHON_PATH /app/cloudflare_updater.py >> /var/log/cron.log 2>&1
20
+ EOF
10
21
11
22
# Give execution rights on the cron job and apply it
12
23
chmod 0644 /etc/cron.d/cloudflare-cron
You can’t perform that action at this time.
0 commit comments