From 2244300ae592701e3c9257d2ae0b94883bb0f5bc Mon Sep 17 00:00:00 2001 From: Magnus Root Date: Sun, 10 Aug 2025 01:06:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8C=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D0=B0=20?= =?UTF-8?q?=D0=BC=D0=B0=D1=80=D1=88=D1=80=D1=83=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarx.sh | 58 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/yarx.sh b/yarx.sh index 4845f25..527b11e 100644 --- a/yarx.sh +++ b/yarx.sh @@ -6,6 +6,41 @@ sudo mkdir /opt/xray sudo unzip ./Xray-linux-64.zip -d /opt/xray sudo chmod +x /opt/xray/xray +read -p "Вы хотите, чтобы через VPN был доступ до сайтов на территории РФ? Есть вариант спалиться (Y/N):" GEOIP +if [ $GEOIP = "Y"] || [ $GEOIP = "y" ]; then + ROUTES=$(cat << EOF + "rules": [], + "domainStrategy": "AsIs" +EOF +) +else + echo "Ну нет так нет" + ROUTES=$(cat << EOF + "domainStrategy": "IPIfNonMatch", + "rules": [ + { + "type": "field", + "ip": [ + "geoip:private" + ], + "outboundTag": "block" + }, + { + "type": "field", + "ip": ["geoip:ru"], + "outboundTag": "block" + }, + { + "type": "field", + "domain": [ + "geosite:category-ads-all" + ], + "outboundTag": "block" + } + ] +EOF +) + sudo cat << EOF > /usr/lib/systemd/system/xray.service [Unit] Description=Xray Service @@ -46,28 +81,7 @@ sudo cat << EOF > /opt/xray/config.json "loglevel": "warning" }, "routing": { - "domainStrategy": "IPIfNonMatch", - "rules": [ - { - "type": "field", - "ip": [ - "geoip:private" - ], - "outboundTag": "block" - }, - { - "type": "field", - "ip": ["geoip:ru"], - "outboundTag": "block" - }, - { - "type": "field", - "domain": [ - "geosite:category-ads-all" - ], - "outboundTag": "block" - } - ] +$ROUTES }, "inbounds": [ {