mirror of
https://github.com/casjaysdevdocker/nextcloud
synced 2026-01-29 19:11:05 -05:00
🦈🏠🐜❗ Initial Commit ❗🐜🦈🏠
This commit is contained in:
38
config/cont-init.d/07-svc-news-updater.sh
Normal file
38
config/cont-init.d/07-svc-news-updater.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/with-contenv sh
|
||||
# shellcheck shell=sh
|
||||
|
||||
SIDECAR_NEWSUPDATER=${SIDECAR_NEWSUPDATER:-0}
|
||||
NC_NEWSUPDATER_THREADS=${NC_NEWSUPDATER_THREADS:-10}
|
||||
NC_NEWSUPDATER_TIMEOUT=${NC_NEWSUPDATER_TIMEOUT:-300}
|
||||
NC_NEWSUPDATER_INTERVAL=${NC_NEWSUPDATER_INTERVAL:-900}
|
||||
NC_NEWSUPDATER_LOGLEVEL=${NC_NEWSUPDATER_LOGLEVEL:-error}
|
||||
|
||||
# Continue only if sidecar news updater container
|
||||
if [ "$SIDECAR_NEWSUPDATER" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ">>"
|
||||
echo ">> Sidecar news updater container detected for Nextcloud"
|
||||
echo ">>"
|
||||
|
||||
# Nextcloud News Updater config file (https://github.com/nextcloud/news-updater#usage)
|
||||
cat > /etc/news_updater.ini <<EOL
|
||||
[updater]
|
||||
threads = ${NC_NEWSUPDATER_THREADS}
|
||||
timeout = ${NC_NEWSUPDATER_TIMEOUT}
|
||||
interval = ${NC_NEWSUPDATER_INTERVAL}
|
||||
loglevel = ${NC_NEWSUPDATER_LOGLEVEL}
|
||||
url = /var/www
|
||||
mode = endless
|
||||
EOL
|
||||
|
||||
# Create service
|
||||
mkdir -p /etc/services.d/news-updater
|
||||
cat > /etc/services.d/news-updater/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
with-contenv
|
||||
s6-setuidgid ${PUID}:${PGID}
|
||||
/usr/bin/nextcloud-news-updater -c /etc/news_updater.ini
|
||||
EOL
|
||||
chmod +x /etc/services.d/news-updater/run
|
||||
Reference in New Issue
Block a user