wip - v1 => It's working !! #1
@ -1,6 +1,6 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
RUN apk add --no-cache curl bash busybox-cron tzdata
|
RUN apk add --no-cache curl bash dcron tzdata
|
||||||
|
|
||||||
COPY update-blocklist.sh /usr/local/bin/update-blocklist.sh
|
COPY update-blocklist.sh /usr/local/bin/update-blocklist.sh
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
@ -3,11 +3,15 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -n "$TZ" ]; then
|
if [ -n "$TZ" ]; then
|
||||||
cp /usr/share/zoneinfo/$TZ /etc/localtime
|
if [ -f "/usr/share/zoneinfo/$TZ" ]; then
|
||||||
echo "$TZ" > /etc/timezone
|
cp "/usr/share/zoneinfo/$TZ" /etc/localtime
|
||||||
|
echo "$TZ" > /etc/timezone
|
||||||
|
else
|
||||||
|
echo "Warning: Timezone file /usr/share/zoneinfo/$TZ not found, skipping timezone setup."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CRON_EXPR="${BLOCKLIST_CRON:-"0 6 * * *"}" # default: every hour
|
CRON_EXPR="${BLOCKLIST_CRON:-"0 6 * * *"}" # default: every day at 6:00 am
|
||||||
SCRIPT_PATH="/usr/local/bin/update-blocklist.sh"
|
SCRIPT_PATH="/usr/local/bin/update-blocklist.sh"
|
||||||
|
|
||||||
echo "Installing cron job with expression: $CRON_EXPR"
|
echo "Installing cron job with expression: $CRON_EXPR"
|
||||||
@ -15,4 +19,4 @@ echo "Installing cron job with expression: $CRON_EXPR"
|
|||||||
echo "$CRON_EXPR root $SCRIPT_PATH" > /etc/crontabs/root
|
echo "$CRON_EXPR root $SCRIPT_PATH" > /etc/crontabs/root
|
||||||
|
|
||||||
echo "Starting cron..."
|
echo "Starting cron..."
|
||||||
crond -f -L /dev/stdout
|
exec crond -f -L /dev/stdout
|
||||||
|
Loading…
x
Reference in New Issue
Block a user