fix: discover default interface
sometimes docker would change the container interface
This commit is contained in:
parent
7d84f1ad9a
commit
04b0f20647
3 changed files with 5 additions and 1 deletions
|
@ -24,6 +24,7 @@ RUN install -dm 2750 -o root -g root /var/lib/monit
|
||||||
COPY --from=build /etc/monitrc /etc/monitrc
|
COPY --from=build /etc/monitrc /etc/monitrc
|
||||||
COPY ./nsupdate.sh /usr/local/bin/nsupdate
|
COPY ./nsupdate.sh /usr/local/bin/nsupdate
|
||||||
COPY ./whatsmyip6.sh /usr/local/bin/whatsmyip6
|
COPY ./whatsmyip6.sh /usr/local/bin/whatsmyip6
|
||||||
|
COPY ./whatsmydefaulteth.sh /usr/local/bin/whatsmydefaulteth
|
||||||
COPY ./syslogize.sh /usr/local/bin/syslogize
|
COPY ./syslogize.sh /usr/local/bin/syslogize
|
||||||
COPY ./zeroconf.sh /usr/local/bin/zeroconf
|
COPY ./zeroconf.sh /usr/local/bin/zeroconf
|
||||||
COPY ./zeroconf.conf /etc/zeroconf.conf
|
COPY ./zeroconf.conf /etc/zeroconf.conf
|
||||||
|
|
3
whatsmydefaulteth.sh
Executable file
3
whatsmydefaulteth.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ip -6 r | grep default | tr -s " " | cut -d " " -f 5
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/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
|
||||||
|
|
Loading…
Reference in a new issue