diff --git a/bin/ncp-diag b/bin/ncp-diag index b7d9ec951..77acd58b2 100644 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -69,8 +69,8 @@ echo "port check 80|$( is_port_open 80 )" echo "port check 443|$( is_port_open 443 )" # LAN -IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) -GW=$( ip r | grep "default via" | awk '{ print $3 }' ) +IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) +GW=$( ip r | grep "default via" | awk '{ print $3 }' | head -1 ) IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) echo "IP|$IP" diff --git a/changelog.md b/changelog.md index 661cd8fc4..c22a2cf0c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v0.53.30](https://github.com/nextcloud/nextcloudpi/commit/63f22a2) (2018-04-20) ncp-report: fix root execution +[v0.53.31](https://github.com/nextcloud/nextcloudpi/commit/0f8a193) (2018-04-21) fix double default gateway + +[v0.53.30](https://github.com/nextcloud/nextcloudpi/commit/344f184) (2018-04-20) ncp-report: fix root execution [v0.53.29](https://github.com/nextcloud/nextcloudpi/commit/79529c7) (2018-04-05) renamed to NextCloudPlus diff --git a/docker-common/nextcloud/020nextcloud b/docker-common/nextcloud/020nextcloud index 1df7939f8..cb97b2368 100755 --- a/docker-common/nextcloud/020nextcloud +++ b/docker-common/nextcloud/020nextcloud @@ -47,7 +47,7 @@ test -f /data/app/config/config.php || { } # Trusted Domain ( local IP ) -IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) +IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) sudo -u www-data php "$OCC" config:system:set trusted_domains 1 --value="$IP" diff --git a/etc/ncp-config.d/dnsmasq.sh b/etc/ncp-config.d/dnsmasq.sh index d022def59..ab6f65c2b 100644 --- a/etc/ncp-config.d/dnsmasq.sh +++ b/etc/ncp-config.d/dnsmasq.sh @@ -60,7 +60,7 @@ configure() return } - local IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) + local IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) local IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) [[ "$IP" == "" ]] && { echo "could not detect IP"; return 1; } diff --git a/etc/ncp-config.d/nc-forward-ports.sh b/etc/ncp-config.d/nc-forward-ports.sh index 9820cd8cd..ae25779c3 100644 --- a/etc/ncp-config.d/nc-forward-ports.sh +++ b/etc/ncp-config.d/nc-forward-ports.sh @@ -33,7 +33,7 @@ install() configure() { - local IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) + local IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) local IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) upnpc -d "$HTTPSPORT_" TCP upnpc -d "$HTTPPORT_" TCP diff --git a/etc/ncp-config.d/nc-notify-updates.sh b/etc/ncp-config.d/nc-notify-updates.sh index 8caac2e99..d6b8861b1 100644 --- a/etc/ncp-config.d/nc-notify-updates.sh +++ b/etc/ncp-config.d/nc-notify-updates.sh @@ -48,7 +48,7 @@ test -e \$NOTIFIED && [[ "\$( cat \$LATEST )" == "\$( cat \$NOTIFIED )" ]] && { echo "Found update from \$( cat \$VERFILE ) to \$( cat \$LATEST ). Sending notification..." -IFACE=\$( ip r | grep "default via" | awk '{ print \$5 }' ) +IFACE=\$( ip r | grep "default via" | awk '{ print \$5 }' | head -1 ) IP=\$( ip a show dev "\$IFACE" | grep global | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 ) sudo -u www-data php /var/www/nextcloud/occ notification:generate \ diff --git a/nextcloudplus.sh b/nextcloudplus.sh index 50c53a1e2..5e73c873f 100644 --- a/nextcloudplus.sh +++ b/nextcloudplus.sh @@ -154,7 +154,7 @@ EOF cat > /usr/local/bin/nextcloud-domain.sh <<'EOF' #!/bin/bash -IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) +IFACE=$( ip r | grep "default via" | awk '{ print $5 }' | head -1 ) IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) # wicd service finishes before completing DHCP while [[ "$IP" == "" ]]; do