mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-02-12 10:31:52 +00:00
Remove dig requirement
This commit is contained in:
parent
80ff962174
commit
4d23ca8d90
2 changed files with 8 additions and 2 deletions
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -1,3 +1,9 @@
|
|||
omr-vps-admin (0.3+20230910) unstable; urgency=medium
|
||||
|
||||
* Remove dig requirement
|
||||
|
||||
-- OpenMPTCProuter <contact@openmptcprouter.com> Sun, 10 Sep 2023 09:25:34 +0200
|
||||
|
||||
omr-vps-admin (0.3+20230901) unstable; urgency=medium
|
||||
|
||||
* 10 router backups on VPS support, rotated
|
||||
|
|
|
@ -1481,19 +1481,19 @@ async def config(userid: Optional[int] = Query(None), serial: Optional[str] = Qu
|
|||
ipv6_addr = os.popen('ip -6 addr show ' + IFACE6 +' | grep -oP "(?<=inet6 ).*(?= scope global)" | cut -d/ -f1').read().rstrip()
|
||||
#ipv4_addr = os.popen('wget -4 -qO- -T 1 https://ip.openmptcprouter.com').read().rstrip()
|
||||
LOG.debug('get server IPv4')
|
||||
ipv4_addr = ''
|
||||
if 'ipv4' in omr_config_data:
|
||||
ipv4_addr = omr_config_data['ipv4']
|
||||
elif 'internet' in omr_config_data and not omr_config_data['internet']:
|
||||
ipv4_addr = os.popen('ip -4 addr show ' + IFACE +' | grep -oP "(?<=inet ).*(?= scope global)" | cut -d/ -f1').read().rstrip()
|
||||
else:
|
||||
ipv4_addr = os.popen("dig -4 TXT +timeout=2 +tries=1 +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'").read().rstrip()
|
||||
#ipv4_addr = os.popen("dig -4 TXT +timeout=2 +tries=1 +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'\"' '{ print $2}'").read().rstrip()
|
||||
if ipv4_addr == '':
|
||||
ipv4_addr = os.popen('wget -4 -qO- -T 1 http://ip.openmptcprouter.com').read().rstrip()
|
||||
if ipv4_addr == '':
|
||||
ipv4_addr = os.popen('wget -4 -qO- -T 1 http://ifconfig.me').read().rstrip()
|
||||
if ipv4_addr != '':
|
||||
set_global_param('ipv4', ipv4_addr)
|
||||
#ipv4_addr = ""
|
||||
|
||||
test_aes = os.popen('cat /proc/cpuinfo | grep aes').read().rstrip()
|
||||
if test_aes == '':
|
||||
|
|
Loading…
Reference in a new issue