#!/bin/shif["$(ls db/dom/ | tr -d 'a-z0-9\n-'| wc -c | tr -d ' \t')" !=0];thenecho"There's a bad TLD. You probably don't want to run any shell scripts." >&2exit1fifor tld in db/dom/* ;doif["$(ls $tld/ | tr -d 'a-z0-9\n-'| wc -c | tr -d ' \t')" !=0];thentld="$(basename $tld)"echo"There's a bad domain under $tld." >&2echo"You probably don't want to run any shell scripts." >&2exit1fifor dom in $tld/* ;doif["$(ls $dom/ns/ | tr -d 'a-z0-9\n.-'| wc -c | tr -d ' \t')" !=0];thendomain="$(basename $dom).$(basename $tld)"echo"There's a bad nameserver under $domain." >&2echo"You probably don't want to run any shell scripts." >&2fifor ns in $dom/ns/* ;doif["$(cat $ns| tr -d '0-9.\n'| wc -c | tr -d ' \t')" !=0];thendomain="$(basename $dom).$(basename $tld)"nsname="$(basename $ns)"echo"There's a bad nameserver IP under $domain, for" >&2echo" $nsname" >&2echo"You probably don't want to run any shell scripts." >&2fidonedonedoneif["$(ls db/ip/ | tr -d 'A-F0-9\n'| wc -c | tr -d ' \t')" !=0];thenecho"There's a bad first octet. You probably don't want to run any shell scripts." >&2exit1for first in db/ip/* ;doif["$(ls $first/ | tr -d 'A-F0-9\n'| wc -c | tr -d ' \t')" !=0];thenecho"There's a bad second octet under $first." >&2echo"You probably don't want to run any shell scripts." >&2exit1for second in $first/* ;doif["$(ls $second/ | tr -d 'A-F0-9\n'| wc -c | tr -d ' \t')" !=0];thenecho"There's a bad third octet under $second." >&2echo"You probably don't want to run any shell scripts." >&2exit1fifor third in $second/* ;doif["$(ls $third/ns/ | tr -d 'a-z0-9\n.-'| wc -c | tr -d ' \t')" !=0];thenip="$(basename $first).$(basename $second).$(basename $third).0/24"echo"There's a bad nameserver under $ip." >&2echo"You probably don't want to run any shell scripts." >&2fifor ns in $third/ns/* ;doif["$(cat $ns| tr -d '0-9.\n'| wc -c | tr -d ' \t')" !=0];thenip="$(basename $first).$(basename $second).$(basename $third).0/24"nsname="$(basename $ns)"echo"There's a bad nameserver IP under $ip, for" >&2echo" $nsname" >&2echo"You probably don't want to run any shell scripts." >&2fidonedonedonefidonefi