Uphosts migrated to being run in Docker

This commit is contained in:
Tony Miller 2025-08-27 09:53:53 +10:00
parent 23c12ae08d
commit 593edcf9c0

View File

@ -1,20 +1,11 @@
#!/usr/bin/env bash
PACKAGE=hosts
SOURCE_DIR="${HOME}/.config"
TARGET_DIR="${HOME}/src/hosts"
mkdir -p ${HOME}/src
if ! [ -d "${TARGET_DIR}" ]; then
git clone https://github.com/StevenBlack/hosts.git "${TARGET_DIR}"
fi
pip3 install -r "${TARGET_DIR}/requirements.txt"
cp "${SOURCE_DIR}/hosts" "${TARGET_DIR}/myhosts"
pushd "${TARGET_DIR}" > /dev/null
python3 "updateHostsFile.py" --auto --replace --flush-dns-cache \
--extensions gambling porn social
popd > /dev/null
docker run --pull always --rm -it \
-v /etc/hosts:/etc/hosts \
ghcr.io/stevenblack/hosts:latest \
updateHostsFile.py \
--auto \
--replace \
--extensions \
gambling \
porn