Skip to content

Commit

Permalink
adjust init dns
Browse files Browse the repository at this point in the history
  • Loading branch information
honwen committed Apr 1, 2021
1 parent 0ef0db2 commit 3e3940a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-shadowsocks
PKG_VERSION:=2.0.2
PKG_RELEASE:=4
PKG_RELEASE:=5

PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
Expand Down
3 changes: 3 additions & 0 deletions files/root/etc/init.d/shadowsocks
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ ss_pre() {
for server in $(config_foreach get_server_ips servers); do
cat <<-EOF >> $tmpDNSconf
ipset=/${server}/ss_spec_dst_sp
server=/${server}/#
server=/${server}/162.14.21.56
server=/${server}/162.14.21.178
server=/${server}/114.114.114.114
Expand All @@ -152,6 +153,8 @@ ss_pre() {
EOF
done

( grep -q 'no-resolv' /etc/dnsmasq.conf /var/etc/dnsmasq.conf.* 2>/dev/null) && sed "/\/#$/d" -i $tmpDNSconf
( grep -q 'no-resolv' /etc/dnsmasq.d/* /var/dnsmasq.d/* 2>/dev/null) && sed "/\/#$/d" -i $tmpDNSconf
( sort -u $tmpDNSconf | sed '/\/\//d; /\/127.0.0.1\//d' > $DNSconf ) && rm -f $tmpDNSconf

echo "server=/${WATCHDOG_ENDPOINT}/127.0.0.1#$(uci_get_by_type port_forward local_port 5300)" >> $DNSconf
Expand Down

0 comments on commit 3e3940a

Please sign in to comment.