mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-23 21:30:15 +00:00
Too many empty lines
This commit is contained in:
parent
b9c6078ec3
commit
28485fc696
1 changed files with 0 additions and 6 deletions
|
@ -1088,17 +1088,12 @@ setVPNDefaultVars(){
|
||||||
generateRandomSubnet() {
|
generateRandomSubnet() {
|
||||||
# Source: https://community.openvpn.net/openvpn/wiki/AvoidRoutingConflicts
|
# Source: https://community.openvpn.net/openvpn/wiki/AvoidRoutingConflicts
|
||||||
declare -a SUBNET_EXCLUDE_LIST=(10.0.0.0/24 10.0.1.0/24 10.1.1.0/24 10.1.10.0/24 10.2.0.0/24 10.8.0.0/24 10.10.1.0/24 10.90.90.0/24 10.100.1.0/24 10.255.255.0/24)
|
declare -a SUBNET_EXCLUDE_LIST=(10.0.0.0/24 10.0.1.0/24 10.1.1.0/24 10.1.10.0/24 10.2.0.0/24 10.8.0.0/24 10.10.1.0/24 10.90.90.0/24 10.100.1.0/24 10.255.255.0/24)
|
||||||
|
|
||||||
readarray -t CURRENTLY_USED_SUBNETS <<< "$(ip route show | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]{1,2}')"
|
readarray -t CURRENTLY_USED_SUBNETS <<< "$(ip route show | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/[0-9]{1,2}')"
|
||||||
|
|
||||||
SUBNET_EXCLUDE_LIST=("${SUBNET_EXCLUDE_LIST[@]}" "${CURRENTLY_USED_SUBNETS[@]}")
|
SUBNET_EXCLUDE_LIST=("${SUBNET_EXCLUDE_LIST[@]}" "${CURRENTLY_USED_SUBNETS[@]}")
|
||||||
|
|
||||||
local MATCHES
|
local MATCHES
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
MATCHES=0
|
MATCHES=0
|
||||||
|
|
||||||
pivpnNET="10.$((RANDOM%256)).$((RANDOM%256)).0"
|
pivpnNET="10.$((RANDOM%256)).$((RANDOM%256)).0"
|
||||||
|
|
||||||
for SUB in "${SUBNET_EXCLUDE_LIST[@]}"; do
|
for SUB in "${SUBNET_EXCLUDE_LIST[@]}"; do
|
||||||
|
@ -1110,7 +1105,6 @@ generateRandomSubnet() {
|
||||||
if [ "${MATCHES}" -eq 0 ]; then
|
if [ "${MATCHES}" -eq 0 ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "${pivpnNET}"
|
echo "${pivpnNET}"
|
||||||
|
|
Loading…
Reference in a new issue