1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 19:41:51 +00:00

Set public IP for uPnP

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-01-28 20:45:45 +01:00
parent 6ab5f128a9
commit afcb30eb2d
2 changed files with 12 additions and 2 deletions

View file

@ -27,7 +27,12 @@ _get_ip() {
[ -z "$check_ipv4_website" ] && check_ipv4_website="http://ip.openmptcprouter.com"
check_ipv6_website="$(uci -q get openmptcprouter.settings.check_ipv6_website)"
[ -z "$check_ipv6_website" ] && check_ipv6_website="http://ipv6.openmptcprouter.com"
uci -q set openmptcprouter.omr.detected_public_ipv4="$(curl -s -4 -m 3 $check_ipv4_website)"
public_ipv4="$(curl -s -4 -m 3 $check_ipv4_website)"
uci -q set openmptcprouter.omr.detected_public_ipv4="${public_ipv4}"
[ -n "$public_ipv4" ] && {
uci -q set upnpd.config.external_ip="${public_ipv4}"
uci -q commit upnpd
}
if [ "$(uci -q get openmptcprouter.omr.shadowsocks)" != "down" ]; then
uci -q set openmptcprouter.omr.detected_ss_ipv4="$(curl -s -4 --socks5 "${proxy}" --max-time 3 $check_ipv4_website)"
else

View file

@ -27,7 +27,12 @@ _get_ip() {
[ -z "$check_ipv4_website" ] && check_ipv4_website="http://ip.openmptcprouter.com"
check_ipv6_website="$(uci -q get openmptcprouter.settings.check_ipv6_website)"
[ -z "$check_ipv6_website" ] && check_ipv6_website="http://ipv6.openmptcprouter.com"
uci -q set openmptcprouter.omr.detected_public_ipv4="$(curl -s -4 -m 3 $check_ipv4_website)"
public_ipv4="$(curl -s -4 -m 3 $check_ipv4_website)"
uci -q set openmptcprouter.omr.detected_public_ipv4="${public_ipv4}"
[ -n "${public_ipv4}" ] && {
uci -q set upnpd.config.external_ip="${public_ipv4}"
uci -q commit upnpd
}
if [ "$(uci -q get openmptcprouter.omr.v2ray)" != "down" ]; then
uci -q set openmptcprouter.omr.detected_ss_ipv4="$(curl -s -4 --socks5 "${proxy}" --max-time 3 $check_ipv4_website)"
else