DynDNS for HAs public IPv6 address

When I log in via the built in “Terminal” or via ssh to hassio, I get the system information including the current public IPv6 address of my installation:

Welcome to the Home Assistant command line.

System information
  IPv4 addresses for end0:
  IPv6 addresses for end0:  2a02:xxxx:xxxx:xxxx:2c10:xxxx:xxxx:c1b9/64, fe80::a681:ba90:1676:a8cb/64

Of course, the IPv6 prefix changes from time to time on most private subscriber lines.

I wonder if it is possible to access this IPv6 address information from the shell? Is it stored in some variable perhaps?

Then I could easily create a command line based Dyn DNS update script.

BTW: Access from the outside via this address to my HA works perfectly.