diff --git a/Dockerfile b/Dockerfile index 193d0ab..9672abc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,7 @@ RUN install -dm 2750 -o root -g root /var/lib/monit COPY --from=build /etc/monitrc /etc/monitrc COPY ./nsupdate.sh /usr/local/bin/nsupdate COPY ./whatsmyip6.sh /usr/local/bin/whatsmyip6 +COPY ./whatsmydefaulteth.sh /usr/local/bin/whatsmydefaulteth COPY ./syslogize.sh /usr/local/bin/syslogize COPY ./zeroconf.sh /usr/local/bin/zeroconf COPY ./zeroconf.conf /etc/zeroconf.conf diff --git a/whatsmydefaulteth.sh b/whatsmydefaulteth.sh new file mode 100755 index 0000000..c5f8225 --- /dev/null +++ b/whatsmydefaulteth.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +ip -6 r | grep default | tr -s " " | cut -d " " -f 5 diff --git a/whatsmyip6.sh b/whatsmyip6.sh index 641fb7d..858a559 100755 --- a/whatsmyip6.sh +++ b/whatsmyip6.sh @@ -1,3 +1,3 @@ #!/bin/sh -ip address show ${1:-eth0} | grep inet6 | grep global | tr -s " " | cut -d " " -f 3 | cut -d / -f 1 +ip address show ${1:-$(whatsmydefaulteth)} | grep inet6 | grep global | tr -s " " | cut -d " " -f 3 | cut -d / -f 1