Skip to content

Commit

Permalink
using resolved to get area
Browse files Browse the repository at this point in the history
i18n
  • Loading branch information
makeding committed Sep 28, 2024
1 parent dd49e1f commit 8ec1e9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion po/ja/fleth.po
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ msgid "We recommend setting MTU to 1460 in MAP-E and DS-Lite."
msgstr "※MAP-EおよびDS-Liteユーザー:MTUを1460に設定することをお勧めします。"

msgid "Auto Renew DHCPv6"
msgstr "DHCPv6自動更新"
msgstr "DHCPv6リースの自動更新"

msgid "We recommend enabling it when using CROSS(10Gbps) plan."
msgstr "※クロス(10ギガ)プランを使用する場合は、有効にすることをお勧めします。"
Expand Down
28 changes: 18 additions & 10 deletions root/usr/sbin/fleth
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,30 @@ r_OFFSET=""

e_AREA="UNKNOWN"

# have other way to detect area(and fle〇's default DNS):
# dhcpv6 request in wan6
# domain iptvf.jp xxxx-east.jp <- point
get_area(){
# east or west
wget --timeout=1 -s "http://[2404:1a8:f401:100::1]/l/__healthcheck" -O /tmp/null > /dev/null 2>&1
if [ $? -eq 0 ]; then
e_AREA="EAST"
DNS=$DNS_E
else
wget --timeout=1 -s "http://[2001:a7ff:ff0e:1::2]/l/__healthcheck" -O /tmp/null > /dev/null 2>&1
if [ $? -eq 0 ]; then
if [ -f /tmp/resolv.conf.d/resolv.conf.auto ]; then
if grep -q "flets-east.jp" /tmp/resolv.conf.d/resolv.conf.auto; then
e_AREA="EAST"
DNS=$DNS_E
elif grep -q "flets-west.jp" /tmp/resolv.conf.d/resolv.conf.auto; then
e_AREA="WEST"
DNS=$DNS_W
fi
fi
if [ "$e_AREA" = "UNKNOWN" ]; then
wget --timeout=1 -s "http://[2404:1a8:f401:100::1]/l/__healthcheck" -O /tmp/null > /dev/null 2>&1
if [ $? -eq 0 ]; then
e_AREA="EAST"
DNS=$DNS_E
else
wget --timeout=1 -s "http://[2001:a7ff:ff0e:1::2]/l/__healthcheck" -O /tmp/null > /dev/null 2>&1
if [ $? -eq 0 ]; then
e_AREA="WEST"
DNS=$DNS_W
fi
fi
fi
echo $e_AREA
}

Expand Down

0 comments on commit 8ec1e9e

Please sign in to comment.