Skip to content

Commit

Permalink
sniffdns
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkgo committed Aug 5, 2023
1 parent 2580f16 commit cb27224
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
20 changes: 12 additions & 8 deletions FILES/usr/bin/ppg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,19 @@ load_clash() {
if ps | grep -v "grep" | grep "/etc/config/v2ray"; then
log "[OK] SNIFF OK." succ
else
if [ -z "$dns_ip" ]; then
dns_ip="1.0.0.1"
fi
if [ -z "$dns_port" ]; then
dns_port="53"
if [ -f /www/sniffdns ]; then
if [ -z "$dns_ip" ]; then
dns_ip="1.0.0.1"
fi
if [ -z "$dns_port" ]; then
dns_port="53"
fi
sed "s/{dns_ip}/$dns_ip/g" /etc/config/v2ray/sniff.json >/tmp/sniff.json
sed -i "s/{dns_port}/$dns_port/g" /tmp/sniff.json
/usr/bin/v2ray run -c /tmp/sniff.json >/dev/tty0 2>&1 &
else
/usr/bin/v2ray run -c /etc/config/v2ray/sniff.json >/dev/tty0 2>&1 &
fi
sed "s/{dns_ip}/$dns_ip" /etc/config/v2ray/sniff.json >/tmp/sniff.json
sed -i "s/{dns_port}/$dns_port" /tmp/sniff.json
/usr/bin/v2ray run -c /etc/config/v2ray/sniff.json >/dev/tty0 2>&1 &
fi
fi
ppgw -apiurl="http://127.0.0.1:""$clash_web_port" -secret="$clash_web_password" -closeall >/dev/tty0
Expand Down
1 change: 1 addition & 0 deletions remakeiso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ if [ "$SNIFF" = "dns" ]; then
sed -i 's/1082/1081/g' $root"/usr/bin/nft.sh"
sed -i 's/1082/1081/g' $root"/usr/bin/nft_tcp.sh"
cp /v2ray $root"/usr/bin/"
touch $root"/www/sniffdns"
fi

if [ -f /data/clash ]; then
Expand Down

0 comments on commit cb27224

Please sign in to comment.