Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.
/ whitelist Public archive
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Docker installation (with Python3 support) #256

@mfedatto

Description

@mfedatto

I'm working on an automated setup, and for the whitelist to work properly on Pi-hole on Docker, I need an entrypoint script. Since a script is needed, I'm working on installing python, checking if the repo was already cloned, if not, cloning it, and if so, pulling it, then proceeding to invoke the whitelist.py and add it to crontab. But the script I managed to reach is facing a fatal error:

fatal: destination path 'whitelist' already exists and is not an empty directory.

My init.sh as entrypoint:

apt install python3 -y
cd

# The name of the directory to check/create
dir_name="whitelist"

# The Git repository URL to clone/pull from
repo_url="https://github.com/anudeepND/whitelist.git"

# Check if the directory already exists
if [ -d "$dir_name" ]; then
  echo "Directory '$dir_name' already exists. Doing a 'git pull'..."
  cd "$dir_name"
  git pull
else
  echo "Directory '$dir_name' does not exist. Doing a 'git clone'..."
  git clone "$repo_url" "$dir_name"
fi

python3 whitelist/scripts/whitelist.py

cat /etc/crontab >> tmp_crontab
echo "0 1 * * */7     root    /root/whitelist/scripts/whitelist.py" >> tmp_crontab

cp tmp_crontab /etc/crontab
rm tmp_crontab

I'm willing to send a PR with the working instructions once I get it working properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions