This script will download and add the Spotify whitelist to your pihole

February 29, 2020 · View on GitHub

#!/bin/bash

This script will download and add the Spotify whitelist to your pihole

Adapted from https://github.com/anudeepND/whitelist/blob/master/scripts/whitelist.sh

Make sure you are pulling the latest raw of pi-hole compatible whitelist: https://gist.github.com/captainhook/9eb4132d6e58888e37c6bc6c73dd4e60

This is INCOMPATIBLE WITH UPCOMING Pihole v5

#==================================================== TICK="[\e[32m ✔ \e[0m]" PIHOLE_LOCATION="/etc/pihole" GRAVITY_UPDATE_COMMAND="pihole -g"

echo -e " \e[1m This script will download and add domains from the repo to whitelist.txt \e[0m" sleep 1 echo -e "\n"

if [ "$(id -u)" != "0" ] ; then echo "This script requires root permissions. Please run this as root!" exit 2 fi

curl -sS https://gist.githubusercontent.com/captainhook/9eb4132d6e58888e37c6bc6c73dd4e60/raw/34caa169dccbb5814b08abe224e01ebdb7cedd67/SpotifyWhitelist | sudo tee -a "PIHOLELOCATION"/whitelist.txt>/dev/nullechoe"{PIHOLE_LOCATION}"/whitelist.txt >/dev/null echo -e " {TICK} \e[32m Adding domains to whitelist... \e[0m" sleep 0.1 echo -e " TICK\e[32mRemovingduplicates...\e[0m"mv"{TICK} \e[32m Removing duplicates... \e[0m" mv "{PIHOLE_LOCATION}"/whitelist.txt "{PIHOLE_LOCATION}"/whitelist.txt.old && cat "{PIHOLE_LOCATION}"/whitelist.txt.old | sort | uniq >> "${PIHOLE_LOCATION}"/whitelist.txt

echo -e " [...] \e[32m Pi-hole gravity rebuilding lists. This may take a while... \e[0m" ${GRAVITY_UPDATE_COMMAND} > /dev/null

echo -e " TICK\e[32mPiholesgravityupdated\e[0m"echoe"{TICK} \e[32m Pi-hole's gravity updated \e[0m" echo -e " {TICK} \e[32m Done! \e[0m"

echo -e " \e[1m Happy AdBlocking :)\e[0m" echo -e "\n\n"