From 4a4bffc3a220139c35e7bf480eadc13333d0ea38 Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Tue, 28 Apr 2020 22:32:36 +0800 Subject: [PATCH] DNS: generator: PP -> PTP --- scripts/dns-reverse-generator.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/dns-reverse-generator.sh b/scripts/dns-reverse-generator.sh index c9b2359..aa2cfed 100755 --- a/scripts/dns-reverse-generator.sh +++ b/scripts/dns-reverse-generator.sh @@ -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"