Adjusted Entrypoint so that it crontabs main.py
This commit is contained in:
@@ -7,11 +7,15 @@ PGID="${PGID:-1600}"
|
|||||||
USER="${USER:-muyu}"
|
USER="${USER:-muyu}"
|
||||||
GROUP="${USER:-muyu}"
|
GROUP="${USER:-muyu}"
|
||||||
CHOWNPATH="/etc/debmirror"
|
CHOWNPATH="/etc/debmirror"
|
||||||
EXTRA_REPOS="${EXTRA_REPOS:-False}"
|
|
||||||
SECURITY_REPOS="${SECURITY_REPOS:-True}"
|
EXTRA_REPOS="${EXTRA_REPOS:-True}"
|
||||||
|
PROXMOX_REPOS="${PROXMOX_REPOS:-True}"
|
||||||
|
DOCKER_REPOS="${DOCKER_REPOS:-True}"
|
||||||
DEBIAN_REPOS="${DEBIAN_REPOS:-True}"
|
DEBIAN_REPOS="${DEBIAN_REPOS:-True}"
|
||||||
OPNSENSE_REPOS="${OPNSENSE_REPOS:-True}"
|
OPNSENSE_REPOS="${OPNSENSE_REPOS:-True}"
|
||||||
|
|
||||||
|
THE_REPO="${THE_REPO:-https://tea.shupogaki.org/YuruC3/Repo-IP-lists}"
|
||||||
|
|
||||||
# Create group if missing
|
# Create group if missing
|
||||||
if ! getent group "$GROUP" >/dev/null 2>&1; then
|
if ! getent group "$GROUP" >/dev/null 2>&1; then
|
||||||
addgroup -g "$PGID" "$GROUP"
|
addgroup -g "$PGID" "$GROUP"
|
||||||
@@ -27,32 +31,44 @@ touch /etc/crontabs/cron-jobs
|
|||||||
|
|
||||||
# Create symlinks based on what is passed
|
# Create symlinks based on what is passed
|
||||||
# Also add cronjobs when applicable
|
# Also add cronjobs when applicable
|
||||||
git clone https://tea.shupogaki.org/YuruC3/Repo-IP-lists
|
git clone $THE_REPO
|
||||||
if [[ "$EXTRA_REPOS" ]]; then
|
if [[ "$EXTRA_REPOS" ]]; then
|
||||||
|
touch /etc/debmirror/Repo-IP-lists/CustomMirrorListV{4,6}
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/CustomMirrorListV4 /etc/debmirror/CustomMirrorListV4
|
ln -s /etc/debmirror/Repo-IP-lists/CustomMirrorListV4 /etc/debmirror/CustomMirrorListV4
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/CustomMirrorListV6 /etc/debmirror/CustomMirrorListV6
|
ln -s /etc/debmirror/Repo-IP-lists/CustomMirrorListV6 /etc/debmirror/CustomMirrorListV6
|
||||||
|
|
||||||
echo "00 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainCustom.py" >> /etc/crontabs/cron-jobs
|
# echo "00 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainCustom.py" >> /etc/crontabs/cron-jobs
|
||||||
fi
|
fi
|
||||||
if [[ "$SECURITY_REPOS" ]]; then
|
if [[ "$PROXMOX_REPOS" ]]; then
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/SecurityMirrorListV4 /etc/debmirror/SecurityMirrorListV4
|
touch /etc/debmirror/Repo-IP-lists/ProxmoxMirrorListV{4,6}
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/SecurityMirrorListV6 /etc/debmirror/SecurityMirrorListV6
|
ln -s /etc/debmirror/Repo-IP-lists/ProxmoxMirrorListV4 /etc/debmirror/ProxmoxMirrorListV4
|
||||||
|
ln -s /etc/debmirror/Repo-IP-lists/ProxmoxMirrorListV6 /etc/debmirror/ProxmoxMirrorListV6
|
||||||
|
|
||||||
echo "05 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainSec.py" >> /etc/crontabs/cron-jobs
|
# echo "05 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainSec.py" >> /etc/crontabs/cron-jobs
|
||||||
|
fi
|
||||||
|
if [[ "$DOCKER_REPOS" ]]; then
|
||||||
|
touch /etc/debmirror/Repo-IP-lists/DockerMirrorListV{4,6}
|
||||||
|
ln -s /etc/debmirror/Repo-IP-lists/DockerMirrorListV4 /etc/debmirror/DockerMirrorListV4
|
||||||
|
ln -s /etc/debmirror/Repo-IP-lists/DockerMirrorListV6 /etc/debmirror/DockerMirrorListV6
|
||||||
|
|
||||||
|
# echo "05 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainSec.py" >> /etc/crontabs/cron-jobs
|
||||||
fi
|
fi
|
||||||
if [[ "$DEBIAN_REPOS" ]]; then
|
if [[ "$DEBIAN_REPOS" ]]; then
|
||||||
|
touch /etc/debmirror/Repo-IP-lists/DebianMirrorListV{4,6}
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/DebianMirrorListV4 /etc/debmirror/DebianMirrorListV4
|
ln -s /etc/debmirror/Repo-IP-lists/DebianMirrorListV4 /etc/debmirror/DebianMirrorListV4
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/DebianMirrorListV6 /etc/debmirror/DebianMirrorListV6
|
ln -s /etc/debmirror/Repo-IP-lists/DebianMirrorListV6 /etc/debmirror/DebianMirrorListV6
|
||||||
|
|
||||||
echo "10 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainDocker.py" >> /etc/crontabs/cron-jobs
|
# echo "10 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainDocker.py" >> /etc/crontabs/cron-jobs
|
||||||
fi
|
fi
|
||||||
if [[ "$OPNSENSE_REPOS" ]]; then
|
if [[ "$OPNSENSE_REPOS" ]]; then
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/OPNsenseMIrrorListV4 /etc/debmirror/OPNsenseMIrrorListV4
|
touch /etc/debmirror/Repo-IP-lists/OPNsenseMIrrorListV{4,6}
|
||||||
ln -s /etc/debmirror/Repo-IP-lists/OPNsenseMIrrorListV6 /etc/debmirror/OPNsenseMIrrorListV6
|
ln -s /etc/debmirror/Repo-IP-lists/OPNsenseMirrorListV4 /etc/debmirror/OPNsenseMirrorListV4
|
||||||
|
ln -s /etc/debmirror/Repo-IP-lists/OPNsenseMirrorListV6 /etc/debmirror/OPNsenseMirrorListV6
|
||||||
|
|
||||||
echo "15 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainOPNsense.py" >> /etc/crontabs/cron-jobs
|
# echo "15 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/mainOPNsense.py" >> /etc/crontabs/cron-jobs
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "00 */4 * * * /etc/debmirror/venv/bin/python3 /etc/debmirror/main.py" >> /etc/crontabs/cron-jobs
|
||||||
echo "30 */4 * * * /bin/sh /etc/debmirror/gitPush.sh" >> /etc/crontabs/cron-jobs
|
echo "30 */4 * * * /bin/sh /etc/debmirror/gitPush.sh" >> /etc/crontabs/cron-jobs
|
||||||
|
|
||||||
# Configure the crontab to work
|
# Configure the crontab to work
|
||||||
|
|||||||
Reference in New Issue
Block a user