Mercurial > hg > anonet-resdb
view scripts/check_db_safety @ 819:f1f0ab9d41b7 draft
i changed the she-bang on configure from sh to bash because it
keeps giving people trouble:
/CA/pikaj00> ./configure: 132: Bad substitution
/CA/pikaj00> root@pikaj00-M-7323U:/services/ircd/resdb#
/relayhell/d3v11> use
/relayhell/d3v11> bash configure
/relayhell/d3v11> did you run that command on slackware?
/relayhell/d3v11> ./configure?
/CA/pikaj00> sorry
/CA/pikaj00> one sec
/CA/pikaj00> yes
/relayhell/d3v11> LOL
/relayhell/d3v11> then the problem is not ubuntu or debian
/CA/shuttle> =)
/relayhell/d3v11> if slackware has the same problem
/CA/pikaj00> bash
/CA/shuttle> what do you think pik
/CA/pikaj00> worked
author | d3v11 <d3v11@d3v11.ano> |
---|---|
date | Sat, 10 Dec 2011 22:23:18 +0000 |
parents | c9a7817b5f1d |
children | 80b445c8c88a |
line wrap: on
line source
#!/bin/sh 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 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-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 exit 1 fi for ns in $dom/ns/* ; do if [ "$(cat $ns | tr -d '0-9.\n' | wc -c | tr -d ' \t')" != 0 ]; then domain="$(basename $dom).$(basename $tld)" nsname="$(basename $ns)" echo "There's a bad nameserver IP under $domain, for" >&2 echo " $nsname" >&2 echo "You probably don't want to run any shell scripts." >&2 exit 1 fi done done done if [ "$(ls db/ip/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then echo "There's a bad first octet. You probably don't want to run any shell scripts." >&2 exit 1 for first in db/ip/* ; do if [ "$(ls $first/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then echo "There's a bad second octet under $first." >&2 echo "You probably don't want to run any shell scripts." >&2 exit 1 for second in $first/* ; do if [ "$(ls $second/ | tr -d 'A-F0-9\n' | wc -c | tr -d ' \t')" != 0 ]; then echo "There's a bad third octet under $second." >&2 echo "You probably don't want to run any shell scripts." >&2 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 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 exit 1 fi for ns in $third/ns/* ; do if [ "$(cat $ns | tr -d '0-9.\n' | wc -c | tr -d ' \t')" != 0 ]; then ip="$(basename $first).$(basename $second).$(basename $third).0/24" nsname="$(basename $ns)" echo "There's a bad nameserver IP under $ip, for" >&2 echo " $nsname" >&2 echo "You probably don't want to run any shell scripts." >&2 exit 1 fi done done done fi done fi