mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
fix IP regex
This commit is contained in:
parent
a695c16693
commit
e5790d4a85
@ -64,7 +64,7 @@ test -e /data/config && {
|
||||
|
||||
# Trusted Domain ( local IP )
|
||||
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 | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 )
|
||||
sudo -u www-data php $OCC config:system:set trusted_domains 2 --value="$IP"
|
||||
|
||||
echo "Starting Apache"
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
|
||||
# Initial Trusted Domain
|
||||
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 | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 )
|
||||
|
||||
docker run -d -p 443:443 -p 80:80 -v ncdata:/data --name nextcloudpi ownyourbits/nextcloudpi $IP
|
||||
|
||||
@ -40,7 +40,7 @@ configure()
|
||||
[[ $ACTIVE_ != "yes" ]] && { service dnsmasq stop; update-rc.d dnsmasq disable; return; }
|
||||
|
||||
local IFACE=$( ip r | grep "default via" | awk '{ print $5 }' )
|
||||
local IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 )
|
||||
local IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 )
|
||||
|
||||
[[ "$IP" == "" ]] && { echo "could not detect IP"; return 1; }
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ install()
|
||||
configure()
|
||||
{
|
||||
local IFACE=$( ip r | grep "default via" | awk '{ print $5 }' )
|
||||
local IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(.\d{1,3}){3}' | head -1 )
|
||||
local IP=$( ip a | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 )
|
||||
upnpc -d "$HTTPSPORT_" TCP
|
||||
upnpc -d "$HTTPPORT_" TCP
|
||||
upnpc -a "$IP" 443 "$HTTPSPORT_" TCP
|
||||
|
||||
@ -106,7 +106,7 @@ 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 | grep "global $IFACE" | grep -oP '\d{1,3}(\.\d{1,3}){3}' | head -1 )
|
||||
# wicd service finishes before completing DHCP
|
||||
while [[ "$IP" == "" ]]; do
|
||||
sleep 3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user