Packages/luci-app-bypass/luci-app-bypass/root/usr/share/bypass/by-preload
2025-01-12 10:41:09 +08:00

30 lines
995 B
Bash

#!/bin/sh
if [ "x$2" = x1 ];then
B=1
while ! A=$(curl -Lfsm 9 https://fastly.jsdelivr.net/gh/QiuSimons/Netflix_IP@master/getflix.txt || curl -Lfsm 9 https://raw.githubusercontent.com/QiuSimons/Netflix_IP/master/getflix.txt );do
[ $B -ge 20 ] && break || let B++
sleep 2
done
for i in $A;do ipset add netflix $i 2>/dev/null;done
fi
if [ "$1" = gfw ];then
A=$(cat /etc/bypass/telegram.list)
for i in $A;do ipset add blacklist $i 2>/dev/null;done
B=1
while ! A=$(nslookup -q=TXT _spf.google.com | grep text | sed -e 's/"v=spf1//' -e 's/ ~all"//' -e 's/ include:/\n/g' | grep -v text);do
[ $B -ge 20 ] && break || let B++
sleep 2
done
for i in $A;do
B=1
while ! nslookup -q=TXT $i >/dev/null 2>&1;do
[ $B -ge 20 ] && break || let B++
sleep 2
done
B=$(nslookup -q=TXT $i | sed -e 's/"v=spf1//' -e 's/ ~all"//' -e 's/ ip.:/\n/g' | grep -E -o '([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}')
for i in $B;do ipset add blacklist $i 2>/dev/null;done
done
fi