1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-11-26 00:00:42 +08:00

DNS: generator: PP -> PTP

This commit is contained in:
Neo_Chen 2020-04-28 22:32:36 +08:00
parent 24b6b066eb
commit 4a4bffc3a2

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -e
FILE="dns/db.10.127"
TUN30_TEMP="$(mktemp)"
PP_TEMP="$(mktemp)"
LO_TEMP="$(mktemp)"
@ -29,8 +30,8 @@ ipcalc()
# PROGRAM BEGIN
sed -i '/AUTOGENERATED/,$d' dns/db.10.127
echo '; AUTOGENERATED' >> dns/db.10.127
sed -i '/AUTOGENERATED/,$d' "$FILE"
echo '; AUTOGENERATED' >> "$FILE"
(
cd route
@ -44,7 +45,7 @@ for i in *; do
print_record "$upstream_ip" "$DOWNSTREAM.$UPSTREAM.tun30.neo."
print_record "$downstream_ip" "$UPSTREAM.$DOWNSTREAM.tun30.neo."
) >> "$TUN30_TEMP"
elif [ "$TYPE" = "PP" ]; then
elif [ "$TYPE" = "PTP" ]; then
i="${i/PP,/}"
upstream_ip="${i%~*}"
downstream_ip="${i#*~}"
@ -68,6 +69,6 @@ done
sort -n < "$PP_TEMP"
echo -e "\n; Loopback Addresses"
sort -n < "$LO_TEMP"
} >> dns/db.10.127
} >> "$FILE"
rm -f "$TUN30_TEMP" "$PP_TEMP" "$LO_TEMP"