Local host querying api.github a lot

ok, no problem

i can get the ipv6 address, but as i have a vpn,i see the following results:

forever
fe80::5357:48c:f2a4:a300
forever
fe80::88be:4d9b:80e8:5faf
forever

im trying to get a one-liner to extract the second line only?

EDIT
ip addr show dev eth0 | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d' seems to grab it

a bit sloppy i think, ad could probably be streamlined, but here it is, in case anyone stumbles on this via searching...

a script to check IPV6 address, compare to Pihole setupVars.conf and update if required.

#!/bin/bash

IPV6_ADDRESS=$(ip addr show dev eth0 | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d')

PIHOLE_IPV6=$(cat /etc/pihole/setupVars.conf | sed -e's/^.*IPV6_ADDRESS=\([^ ]*\)\/.*$/\1/;t;d')

if [ "$PIHOLE_IPV6" == "$IPV6_ADDRESS" ]
then
echo "SAME IPV6"
else
sudo sed -i.bak "/IPV6_ADDRESS/d;" "/etc/pihole/setupVars.conf"
echo "IPV6_ADDRESS=${IPV6_ADDRESS}/64" | sudo tee --append  "/etc/pihole/setupVars.conf"
echo "DONE"
fi

This issue is resolved in v3.2.1, which was released today.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.