Skip to content

Commit

Permalink
added HTTP port to port forwarding rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Aug 10, 2017
1 parent 5e321a8 commit e9aa777
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions etc/nextcloudpi-config.d/nc-forward-ports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# More at: https://ownyourbits.com
#

PORT_=443
HTTPSPORT_=443
HTTPPORT_=80
DESCRIPTION="Set port forwarding to access from outside (UPnP)"

show_info()
Expand All @@ -41,8 +42,10 @@ 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 )
upnpc -d $PORT_ TCP
upnpc -a $IP 443 $PORT_ TCP
upnpc -d $HTTPSPORT_ TCP
upnpc -d $HTTPPORT_ TCP
upnpc -a $IP 443 $HTTPSPORT_ TCP
upnpc -a $IP 80 $HTTPPORT_ TCP
}

cleanup()
Expand Down

0 comments on commit e9aa777

Please sign in to comment.