anudeepND / anudeepND/whitelist
Docker installation (with Python3 support)
- Lenguaje dominante
- Python
- Estrellas
- 4.4k
- Forks
- 289
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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 update
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.