view scripts/export/dn42_registry @ 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 4ace60b88ec0
children
line wrap: on
line source

#!/bin/sh
if ! ./scripts/check_db_safety; then
 exit 1
fi
mkdir -p export/dn42/data/dns || exit 1
for d in db/dom/dn42/* ; do
 domain="`basename $d`.dn42"
 owner="`cat $d/owner | tr a-z A-Z`-DN42"
 (
  echo -e "domain:\t\t$domain"
  for ns in $d/ns/* ; do
   nsname="`basename $ns`"
   nsip="`cat $ns`"
   echo -e "nserver:\t$nsname $nsip"
  done
  echo -e "status:\t\tconnect"
  echo -e "admin-c:\t$owner"
  echo -e "tech-c:\t\tRESDB-DN42"
 ) > "export/dn42/data/dns/$domain"
done
mkdir -p export/dn42/data/inetnum || exit 1
for i3 in db/ip/AC/16/?? ; do
 third="$(basename $i3 | ./scripts/hex2dec)"
 second="$(basename $(dirname $i3) | ./scripts/hex2dec)"
 first="$(basename $(dirname $(dirname $i3)) | ./scripts/hex2dec)"
 ip="$first.$second.$third"
 ownershort="`cat $i3/owner | tr a-z A-Z`"
 owner="$ownershort-DN42"
 (
  echo -e "inetnum:\t$ip.0 - $ip.255"
  for ns in $i3/ns/* ; do
   nsname="`basename $ns`"
   nsip="`cat $ns`"
   echo -e "nserver:\t$nsname $nsip"
  done
  echo -e "netname:\t$ownershort's dn42 network"
  echo -e "country:\tunknown to resdb"
  echo -e "admin-c:\t$owner"
  echo -e "tech-c:\t\tRESDB-DN42"
  echo -e "status:\t\tASSIGNED"
 ) > "export/dn42/data/inetnum/$ip.0_24"
done