#!/bin/bash # ============================================ # Rewire Free — Basic Content Protection # Version 1.0 # ============================================ # This script configures your Mac with: # - CleanBrowsing Family DNS filter # - 50 major adult site blocks via /etc/hosts # - Automatic DNS cache flush # # Run with: sudo bash ~/Downloads/rewire-free.sh # Uninstall: sudo bash ~/Downloads/rewire-free.sh --uninstall # ============================================ set -e # Colors GREEN='\033[0;32m' GOLD='\033[0;33m' RED='\033[0;31m' NC='\033[0m' echo "" echo -e "${GOLD}╔══════════════════════════════════════╗${NC}" echo -e "${GOLD}║ Rewire Free — v1.0 ║${NC}" echo -e "${GOLD}║ Basic Content Protection ║${NC}" echo -e "${GOLD}╚══════════════════════════════════════╝${NC}" echo "" # Check for root if [ "$EUID" -ne 0 ]; then echo -e "${RED}Error: Please run with sudo${NC}" echo "Usage: sudo bash ~/Downloads/rewire-free.sh" exit 1 fi HOSTS_MARKER="# === REWIRE FREE BLOCKLIST ===" # --- UNINSTALL --- if [ "$1" = "--uninstall" ]; then echo -e "${GOLD}Uninstalling Rewire Free...${NC}" # Remove hosts entries if grep -q "$HOSTS_MARKER" /etc/hosts 2>/dev/null; then sed -i '' "/$HOSTS_MARKER/,/# === END REWIRE ===/d" /etc/hosts echo -e "${GREEN}✓ Removed blocked domains from /etc/hosts${NC}" fi # Reset DNS to automatic networksetup -listallnetworkservices | tail -n +2 | while read service; do networksetup -setdnsservers "$service" empty 2>/dev/null || true done echo -e "${GREEN}✓ Reset DNS to automatic${NC}" # Flush DNS cache dscacheutil -flushcache 2>/dev/null || true killall -HUP mDNSResponder 2>/dev/null || true echo -e "${GREEN}✓ Flushed DNS cache${NC}" echo "" echo -e "${GREEN}Rewire Free has been completely removed.${NC}" exit 0 fi # --- INSTALL --- echo -e "${GOLD}[1/3] Setting DNS to CleanBrowsing Family...${NC}" networksetup -listallnetworkservices | tail -n +2 | while read service; do networksetup -setdnsservers "$service" 185.228.168.168 185.228.169.168 2>/dev/null || true done echo -e "${GREEN}✓ DNS configured${NC}" echo -e "${GOLD}[2/3] Adding blocked domains to /etc/hosts...${NC}" # Remove old entries if they exist if grep -q "$HOSTS_MARKER" /etc/hosts 2>/dev/null; then sed -i '' "/$HOSTS_MARKER/,/# === END REWIRE ===/d" /etc/hosts fi cat >> /etc/hosts << 'BLOCKLIST' # === REWIRE FREE BLOCKLIST === 0.0.0.0 pornhub.com 0.0.0.0 www.pornhub.com 0.0.0.0 xvideos.com 0.0.0.0 www.xvideos.com 0.0.0.0 xnxx.com 0.0.0.0 www.xnxx.com 0.0.0.0 xhamster.com 0.0.0.0 www.xhamster.com 0.0.0.0 redtube.com 0.0.0.0 www.redtube.com 0.0.0.0 youporn.com 0.0.0.0 www.youporn.com 0.0.0.0 tube8.com 0.0.0.0 www.tube8.com 0.0.0.0 spankbang.com 0.0.0.0 www.spankbang.com 0.0.0.0 onlyfans.com 0.0.0.0 www.onlyfans.com 0.0.0.0 chaturbate.com 0.0.0.0 www.chaturbate.com 0.0.0.0 stripchat.com 0.0.0.0 www.stripchat.com 0.0.0.0 livejasmin.com 0.0.0.0 www.livejasmin.com 0.0.0.0 cam4.com 0.0.0.0 www.cam4.com 0.0.0.0 myfreecams.com 0.0.0.0 www.myfreecams.com 0.0.0.0 bongacams.com 0.0.0.0 www.bongacams.com 0.0.0.0 eporner.com 0.0.0.0 www.eporner.com 0.0.0.0 hqporner.com 0.0.0.0 www.hqporner.com 0.0.0.0 brazzers.com 0.0.0.0 www.brazzers.com 0.0.0.0 porntrex.com 0.0.0.0 www.porntrex.com 0.0.0.0 fansly.com 0.0.0.0 www.fansly.com 0.0.0.0 redgifs.com 0.0.0.0 www.redgifs.com 0.0.0.0 rule34.xxx 0.0.0.0 www.rule34.xxx 0.0.0.0 nhentai.net 0.0.0.0 www.nhentai.net 0.0.0.0 hanime.tv 0.0.0.0 www.hanime.tv 0.0.0.0 literotica.com 0.0.0.0 www.literotica.com 0.0.0.0 motherless.com 0.0.0.0 www.motherless.com 0.0.0.0 imagefap.com 0.0.0.0 www.imagefap.com 0.0.0.0 porn.com 0.0.0.0 www.porn.com # === END REWIRE === BLOCKLIST echo -e "${GREEN}✓ 50 domains blocked${NC}" echo -e "${GOLD}[3/3] Flushing DNS cache...${NC}" dscacheutil -flushcache 2>/dev/null || true killall -HUP mDNSResponder 2>/dev/null || true echo -e "${GREEN}✓ DNS cache flushed${NC}" echo "" echo -e "${GREEN}╔══════════════════════════════════════╗${NC}" echo -e "${GREEN}║ Rewire Free is now active! ✓ ║${NC}" echo -e "${GREEN}╚══════════════════════════════════════╝${NC}" echo "" echo "Protection: CleanBrowsing DNS + 50 blocked domains" echo "To uninstall: sudo bash ~/Downloads/rewire-free.sh --uninstall" echo "" echo -e "${GOLD}Want all 6 layers + 544 domains? → getrewire.app/pro${NC}" echo ""