diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-11-16 21:21:10 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-11-16 21:21:42 +0300 |
commit | 7e126fdda9bcdc5778c231e144006fbb16b2f1b4 (patch) | |
tree | a752144632bcb571e1e52cfaa20f1aef5de3f51b /nextcloudpi.sh | |
parent | ac9989dd28dd780eba6afdb198402d7c8a58f7c1 (diff) |
improve IP detectionv0.34.13
Diffstat (limited to 'nextcloudpi.sh')
-rw-r--r-- | nextcloudpi.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nextcloudpi.sh b/nextcloudpi.sh index ed0cbd7a..a7141e9f 100644 --- a/nextcloudpi.sh +++ b/nextcloudpi.sh @@ -139,11 +139,11 @@ EOF cat > /usr/local/bin/nextcloud-domain.sh <<'EOF' #!/bin/bash IFACE=$( ip r | grep "default via" | awk '{ print $5 }' ) -IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | 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 sleep 3 - IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 ) + IP=$( ip a show dev "$IFACE" | grep global | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 ) done cd /var/www/nextcloud sudo -u www-data php occ config:system:set trusted_domains 1 --value=$IP |