summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSeekingFor <nobody@nowhere>2014-04-16 05:16:49 +0000
committerSeekingFor <nobody@nowhere>2014-04-16 05:16:49 +0000
commita89aee92a06e769b4bd138dc4256acef92c5ff3d (patch)
tree0498d8e31b5df84e21f99a9a2c531330677c64ea /scripts
parent4ff1ad5fa85867c3e018ef257f2163ea380a65b4 (diff)
downloadresdb-a89aee92a06e769b4bd138dc4256acef92c5ff3d.tar.gz
resdb-a89aee92a06e769b4bd138dc4256acef92c5ff3d.zip
check_db_safety: allow - in domain names and dns server names, escape - correctly for tr -d
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_db_safety8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/check_db_safety b/scripts/check_db_safety
index 9b2e98c..2019929 100755
--- a/scripts/check_db_safety
+++ b/scripts/check_db_safety
@@ -1,17 +1,17 @@
#!/bin/sh
-if [ "$(ls db/dom/ | tr -d 'a-z0-9\n-' | wc -c | tr -d ' \t')" != 0 ]; then
+if [ "$(ls db/dom/ | tr -d 'a-z0-9\n\-' | wc -c | tr -d ' \t')" != 0 ]; then
echo "There's a bad TLD. You probably don't want to run any shell scripts." >&2
exit 1
fi
for tld in db/dom/* ; do
- if [ "$(ls $tld/ | tr -d 'a-z0-9\n-' | wc -c | tr -d ' \t')" != 0 ]; then
+ if [ "$(ls $tld/ | tr -d 'a-z0-9\n\-' | wc -c | tr -d ' \t')" != 0 ]; then
tld="$(basename $tld)"
echo "There's a bad domain under $tld." >&2
echo "You probably don't want to run any shell scripts." >&2
exit 1
fi
for dom in $tld/* ; do
- if [ "$(ls $dom/ns/ | tr -d 'A-Fa-z0-9\n.-:' | wc -c | tr -d ' \t')" != 0 ]; then
+ if [ "$(ls $dom/ns/ | tr -d 'A-Fa-z0-9\n.:\-' | wc -c | tr -d ' \t')" != 0 ]; then
domain="$(basename $dom).$(basename $tld)"
echo "There's a bad nameserver under $domain." >&2
echo "You probably don't want to run any shell scripts." >&2
@@ -44,7 +44,7 @@ if [ "$(ls db/ip/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then
exit 1
fi
for third in $second/* ; do
- if [ "$(ls $third/ns/ | tr -d 'a-z0-9\n.-' | wc -c | tr -d ' \t')" != 0 ]; then
+ if [ "$(ls $third/ns/ | tr -d 'a-z0-9\n.\-' | wc -c | tr -d ' \t')" != 0 ]; then
ip="$(basename $first).$(basename $second).$(basename $third).0/24"
echo "There's a bad nameserver under $ip." >&2
echo "You probably don't want to run any shell scripts." >&2