From 4329eea039f3284f72001b74e0f87232dc016a4f Mon Sep 17 00:00:00 2001 From: nachoparker Date: Wed, 8 Nov 2017 18:07:49 +0100 Subject: noip: manage many interfaces and fix return value --- changelog.md | 8 ++++++++ etc/nextcloudpi-config.d/no-ip.sh | 7 ++++++- lamp.sh | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 4000637d..2ae408c0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,12 @@ +[v0.32.6](https://github.com/nextcloud/nextcloudpi/commit/83adc32) (2017-11-08) noip: manage many interfaces and fix return value + +[v0.32.5 ](https://github.com/nextcloud/nextcloudpi/commit/f192b20) (2017-11-08) update: wait running apt processes + +[v0.32.4 ](https://github.com/nextcloud/nextcloudpi/commit/63e0f73) (2017-11-08) fail2ban: update logpath on nc-datadir or nc-restore + +[v0.32.3 ](https://github.com/nextcloud/nextcloudpi/commit/bfe0b61) (2017-11-06) nc-notify-updates: rework for more accuracy + [v0.32.2 ](https://github.com/nextcloud/nextcloudpi/commit/d46f567) (2017-11-04) ncp-web: fix return value [v0.32.1 ](https://github.com/nextcloud/nextcloudpi/commit/8f28660) (2017-11-04) build: replace user pi for user ncp diff --git a/etc/nextcloudpi-config.d/no-ip.sh b/etc/nextcloudpi-config.d/no-ip.sh index e5e895f5..1e2ddeed 100644 --- a/etc/nextcloudpi-config.d/no-ip.sh +++ b/etc/nextcloudpi-config.d/no-ip.sh @@ -90,7 +90,12 @@ configure() ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; return 1; echo "noip DDNS disabled"; } - /usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf -U "$TIME_" -u "$USER_" -p "$PASS_" || return 1 + local IF=$( ip -br l | awk '{ if ( $2 == "UP" ) print $1 }' | head -1 ) + [[ "$IF" != "" ]] && IF="-I $IF" + + /usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf $IF -U "$TIME_" -u "$USER_" -p "$PASS_" | tee >(cat - >&2) \ + | grep -q "New configuration file .* created" || return 1 + update-rc.d noip2 enable service noip2 restart cd /var/www/nextcloud diff --git a/lamp.sh b/lamp.sh index c748f71b..73079c7f 100644 --- a/lamp.sh +++ b/lamp.sh @@ -145,7 +145,7 @@ EOF configure() { :; } -cleanup() +cleanup() { apt-get autoremove -y apt-get clean -- cgit v1.2.3