minor fixes
This commit is contained in:
parent
a797b50fc4
commit
2d0d225a0e
|
@ -92,11 +92,11 @@ GetServernameSEDEntry() {
|
||||||
}
|
}
|
||||||
GetOwnGlueRecords() {
|
GetOwnGlueRecords() {
|
||||||
ServerName="$DNSSCRIPT_SERVER_NAME"
|
ServerName="$DNSSCRIPT_SERVER_NAME"
|
||||||
if [ ! -z "${ServerName##*$1}" ]; then
|
if [ -n "${ServerName##*$1}" ]; then
|
||||||
ServerName="$ServerName""$1"
|
ServerName="$ServerName""$1"
|
||||||
fi
|
fi
|
||||||
ServerName="$ServerName""."
|
ServerName="$ServerName""."
|
||||||
echo "$(sed -ne 's/^\s*'"$(GetServernameSEDEntry "$1")"'\(\s\+[Ii][Nn]\s\+\([Aa]\|[Aa]\{4\}\)\s\+.*\)$/'"$ServerName"'\2/p' "$2")"
|
sed -ne 's/^\s*'"$(GetServernameSEDEntry "$1")"'\(\s\+[Ii][Nn]\s\+\([Aa]\|[Aa]\{4\}\)\s\+.*\)$/'"$ServerName"'\2/p' "$2"
|
||||||
}
|
}
|
||||||
GetOwnHoods() {
|
GetOwnHoods() {
|
||||||
Entries="$(sed -ne "s/^\s*\(\S*\).*\s\+[Ii][Nn]\s\+[Nn][Ss]\s\+""$(GetServernameSEDEntry "$1")""\s*;\s*Subnets:\s*\([^;]*\)/\1 \3/p" "$2")"
|
Entries="$(sed -ne "s/^\s*\(\S*\).*\s\+[Ii][Nn]\s\+[Nn][Ss]\s\+""$(GetServernameSEDEntry "$1")""\s*;\s*Subnets:\s*\([^;]*\)/\1 \3/p" "$2")"
|
||||||
|
|
|
@ -38,8 +38,8 @@ cd "$UpdateScriptsFolder"
|
||||||
. ./dns-functions.sh
|
. ./dns-functions.sh
|
||||||
|
|
||||||
MasterFile="$ZoneFilesFolder""db.""$CommunityDomain"
|
MasterFile="$ZoneFilesFolder""db.""$CommunityDomain"
|
||||||
BindInternalFile="$BindIncludeFileFolder""$CommunityDomain""-internal.conf"
|
BindInternalConf="$BindIncludeFileFolder""$CommunityDomain""-internal.conf"
|
||||||
BindExternalFile="$BindIncludeFileFolder""$CommunityDomain""-external.conf"
|
BindExternalConf="$BindIncludeFileFolder""$CommunityDomain""-external.conf"
|
||||||
BindIcvpnAcl="$BindIncludeFileFolder""icvpn-acl.conf"
|
BindIcvpnAcl="$BindIncludeFileFolder""icvpn-acl.conf"
|
||||||
|
|
||||||
PreFetchMasterSerial="$(GetZoneFileSerial "$MasterFile")"
|
PreFetchMasterSerial="$(GetZoneFileSerial "$MasterFile")"
|
||||||
|
@ -50,15 +50,15 @@ if [ $((PostFetchMasterSerial)) -gt $((PreFetchMasterSerial)) ]; then
|
||||||
ReloadZone "$CommunityDomain" "$InternalViews"
|
ReloadZone "$CommunityDomain" "$InternalViews"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -f "$BindExternalFile"".tmp" ] && rm "$BindExternalFile"".tmp"
|
rm -f "$BindExternalConf"".tmp"
|
||||||
[ -f "$BindInternalFile"".tmp" ] && rm "$BindInternalFile"".tmp"
|
rm -f "$BindInternalConf"".tmp"
|
||||||
InsertZoneToIncludeFile "$CommunityDomain" "$ZoneFilesFolder""db.""$CommunityDomain" "$BindExternalFile"".tmp"
|
InsertZoneToIncludeFile "$CommunityDomain" "$ZoneFilesFolder""db.""$CommunityDomain" "$BindExternalConf"".tmp"
|
||||||
|
|
||||||
for Subnet in $CommunitySubnets; do
|
for Subnet in $CommunitySubnets; do
|
||||||
ReverseDomains="$(GetReverseDomains "$Subnet")"
|
ReverseDomains="$(GetReverseDomains "$Subnet")"
|
||||||
for RDomain in $ReverseDomains; do
|
for RDomain in $ReverseDomains; do
|
||||||
./update-rdnszone.sh "$RDomain" "$ForwardZones" "$ZoneFilesFolder" "$TTLReReExMi" "$InternalViews"
|
./update-rdnszone.sh "$RDomain" "$ForwardZones" "$ZoneFilesFolder" "$TTLReReExMi" "$InternalViews"
|
||||||
InsertZoneToIncludeFile "$RDomain" "$ZoneFilesFolder""$(GetReverseZoneFileFromZone "${RDomain%*.}")" "$BindInternalFile"".tmp"
|
InsertZoneToIncludeFile "$RDomain" "$ZoneFilesFolder""$(GetReverseZoneFileFromZone "${RDomain%*.}")" "$BindInternalConf"".tmp"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -83,14 +83,14 @@ for Hood in $Hoods; do
|
||||||
echo "$(GetOwnGlueRecords "$CommunityDomain" "$MasterFile")" >> "$HoodZoneFile"
|
echo "$(GetOwnGlueRecords "$CommunityDomain" "$MasterFile")" >> "$HoodZoneFile"
|
||||||
fi
|
fi
|
||||||
./update-hoodzone.sh "$HoodZoneFile" "$HoodSubDomain"".""$CommunityDomain" "$Subnets" "$InternalViews"
|
./update-hoodzone.sh "$HoodZoneFile" "$HoodSubDomain"".""$CommunityDomain" "$Subnets" "$InternalViews"
|
||||||
InsertZoneToIncludeFile "$HoodSubDomain"".""$CommunityDomain" "$ZoneFilesFolder""db.""$HoodSubDomain"".""$CommunityDomain" "$BindExternalFile"".tmp"
|
InsertZoneToIncludeFile "$HoodSubDomain"".""$CommunityDomain" "$ZoneFilesFolder""db.""$HoodSubDomain"".""$CommunityDomain" "$BindExternalConf"".tmp"
|
||||||
|
|
||||||
HoodForwardZones="$ForwardZones $HoodSubDomain"".""$CommunityDomain""/""$ZoneFilesFolder""db.""$HoodSubDomain"".""$CommunityDomain"
|
HoodForwardZones="$ForwardZones $HoodSubDomain"".""$CommunityDomain""/""$ZoneFilesFolder""db.""$HoodSubDomain"".""$CommunityDomain"
|
||||||
for Subnet in $Subnets; do
|
for Subnet in $Subnets; do
|
||||||
ReverseDomains="$(GetReverseDomains "$Subnet")"
|
ReverseDomains="$(GetReverseDomains "$Subnet")"
|
||||||
for RDomain in $ReverseDomains; do
|
for RDomain in $ReverseDomains; do
|
||||||
./update-rdnszone.sh "$RDomain" "$HoodForwardZones" "$ZoneFilesFolder" "$TTLReReExMi" "$InternalViews"
|
./update-rdnszone.sh "$RDomain" "$HoodForwardZones" "$ZoneFilesFolder" "$TTLReReExMi" "$InternalViews"
|
||||||
InsertZoneToIncludeFile "$RDomain" "$ZoneFilesFolder""$(GetReverseZoneFileFromZone "${RDomain%*.}")" "$BindInternalFile"".tmp"
|
InsertZoneToIncludeFile "$RDomain" "$ZoneFilesFolder""$(GetReverseZoneFileFromZone "${RDomain%*.}")" "$BindInternalConf"".tmp"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ for Hood in $Hoods; do
|
||||||
./update-extzone.sh "$InternFile" "$ExternFile" "$Domain" "$ExternalView"
|
./update-extzone.sh "$InternFile" "$ExternFile" "$Domain" "$ExternalView"
|
||||||
done
|
done
|
||||||
|
|
||||||
sed -i "1i include \"""$BindExternalFile""\";\n" "$BindInternalFile"".tmp"
|
sed -i "1i include \"""$BindExternalConf""\";\n" "$BindInternalConf"".tmp"
|
||||||
./update-public-acl.sh "$BindIcvpnAcl"".tmp"
|
./update-public-acl.sh "$BindIcvpnAcl"".tmp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,8 +115,8 @@ UpdateBindConfig() {
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateBindConfig "$BindIcvpnAcl"
|
UpdateBindConfig "$BindIcvpnAcl"
|
||||||
UpdateBindConfig "$BindInternalFile"
|
UpdateBindConfig "$BindInternalConf"
|
||||||
UpdateBindConfig "$BindExternalFile"
|
UpdateBindConfig "$BindExternalConf"
|
||||||
|
|
||||||
if [ $ReConfigBind -eq 0 ]; then
|
if [ $ReConfigBind -eq 0 ]; then
|
||||||
if [ $DNSSCRIPT_BIND_RELOAD_VER -eq 0 ]; then
|
if [ $DNSSCRIPT_BIND_RELOAD_VER -eq 0 ]; then
|
||||||
|
|
|
@ -24,7 +24,7 @@ OldLeases="$(sed -e '/^;### Leases ###/,$!d' "$HoodZoneFile" | sed 1d)"
|
||||||
if [ -f "/tmp/dhcp.leases" ]; then
|
if [ -f "/tmp/dhcp.leases" ]; then
|
||||||
DnsmasqLeases="$(sed -ne 's/^\s*\(\S\+\s\+\)\{2\}\(\S\+\)\s\+\([_0-9a-zA-Z-]\+\)\s\+.*/\3 IN A \2/p' "/tmp/dhcp.leases")"
|
DnsmasqLeases="$(sed -ne 's/^\s*\(\S\+\s\+\)\{2\}\(\S\+\)\s\+\([_0-9a-zA-Z-]\+\)\s\+.*/\3 IN A \2/p' "/tmp/dhcp.leases")"
|
||||||
for Subnet in $Subnets; do
|
for Subnet in $Subnets; do
|
||||||
IsValidIPv4Subnet "$Subnet" && NewLeases="$(echo "$NewLeases";echo "$(GetLeaseEntriesInSubnet "$DnsmasqLeases" "$Subnet")")"
|
IsValidIPv4Subnet "$Subnet" && NewLeases="$(echo "$NewLeases"; GetLeaseEntriesInSubnet "$DnsmasqLeases" "$Subnet")"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ GetIPEntries() {
|
||||||
|
|
||||||
ReverseEntry() {
|
ReverseEntry() {
|
||||||
if [ -z "$RZoneIsIPv6" ]; then
|
if [ -z "$RZoneIsIPv6" ]; then
|
||||||
echo "$(GetReverseDomains "$1""/32")"
|
GetReverseDomains "$1""/32"
|
||||||
else
|
else
|
||||||
echo "$(GetReverseDomains "$1""/128")"
|
GetReverseDomains "$1""/128"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,6 @@ for File in /wwwup/*; do
|
||||||
LastFile="$File"
|
LastFile="$File"
|
||||||
done
|
done
|
||||||
|
|
||||||
cat "$LastFile" | sed -e 's/%\([0-9A-F][0-9A-F]\)/\\\\x\1/g' | xargs echo -e > /tmp/hosts/remote.leases
|
sed -e 's/%\([0-9A-F][0-9A-F]\)/\\\\x\1/g' "$LastFile" | xargs echo -e > /tmp/hosts/remote.leases
|
||||||
|
|
||||||
rm /wwwup/*
|
rm /wwwup/*
|
Loading…
Reference in New Issue