dotfiles/.local/bin/uphosts
2025-08-21 22:43:09 +10:00

21 lines
476 B
Bash
Executable File

#!/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