From c7d973b37c88d7a0b70be01bebc1e63df6e8b781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Cie=C5=9Blik?= <73119351+Bartosz-lab@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:30:31 +0200 Subject: [PATCH] [fix] Added ipv6 support to openwisp-get-address #224 Fixes #224. --- openwisp-config/files/sbin/openwisp-get-address.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 openwisp-config/files/sbin/openwisp-get-address.lua diff --git a/openwisp-config/files/sbin/openwisp-get-address.lua b/openwisp-config/files/sbin/openwisp-get-address.lua old mode 100644 new mode 100755 index ce66eee7..645d3cb5 --- a/openwisp-config/files/sbin/openwisp-get-address.lua +++ b/openwisp-config/files/sbin/openwisp-get-address.lua @@ -7,7 +7,10 @@ local os = require('os') local net = require('openwisp.net') local name = arg[1] -local interface = net.get_interface(name) +local interface = net.get_interface(name, 'inet') +if not interface then + interface = net.get_interface(name, 'inet6') +end if interface then print(interface.addr)